Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] <File are larger than the max prompt length> #327

Open
dingli-pacvue opened this issue Mar 5, 2024 · 1 comment
Open

[BUG] <File are larger than the max prompt length> #327

dingli-pacvue opened this issue Mar 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dingli-pacvue
Copy link

dingli-pacvue commented Mar 5, 2024

ERROR Changes to file xxxx.java are larger than the max prompt length, consider using a model with a larger context window. Skipping file changes...
Run npx code-review-gpt review --ci=github --model=gpt-3.5-turbo-16k --debug
DEBUG Args: {"_":["review"],"ci":"github","model":"gpt-3.5-turbo-16k","debug":true,"setupTarget":"github","setup-target":"github","commentPerFile":false,"comment-per-file":false,"reviewType":"changed","review-type":"changed","provider":"openai","$0":"node_modules/.bin/code-review-gpt"}

we have use gpt-3.5-turbo-16k, but file is easy more than 16k, we only want to compare changes content. how to set?

my yml:

name: Code Review GPT

on:
pull_request:
branches:
- master

permissions:
id-token: write
pull-requests: write
contents: read
actions: read

jobs:
code-review-gpt:
runs-on: ubuntu-latest

steps:
  - uses: actions/checkout@v4
    with:
      fetch-depth: 0

  - uses: actions/setup-node@v3
    with:
      node-version: 18

  - name: Install code-review-gpt
    run: npm install code-review-gpt

  - name: Run code review script
    run: npx code-review-gpt review --ci=github --model=gpt-3.5-turbo-16k --debug
    env:
      GITHUB_TOKEN: ${{ github.token }}
      BASE_SHA: ${{ github.event.pull_request.base.sha }}
      GITHUB_SHA: ${{ github.sha }}
      OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
@dingli-pacvue dingli-pacvue added the bug Something isn't working label Mar 5, 2024
@dingli-pacvue
Copy link
Author

dingli-pacvue commented Mar 5, 2024

now have an other issues

ERROR Error parsing JSON response from the model: [{"fileName":"/home/runner/work/commerceapi-1p/commerceapi-1p/commerce/src/main/java/com/pacvue/commerce/commerce/controller/catalog/CatalogController.java","promptContent":"package com.pacvue.commerce.commerce.controller.catalog;\n+\nimport cn.hutool.core.collection.CollUtil;\nimport cn.hutool.core.collection.CollectionUtil;\nimport com.alibaba.fastjson.JSONObject;\nimport com.github.pagehelper.PageInfo;\nimport com.github.pagehelper.PageSerializable;\nimport com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;\nimport com.pacvue.commerce.commerce.config.SecurityContextHelper;\nimport com.pacvue.commerce.commercesdkfeign.dto.catalog.GetCatalogItemReqDto;\nimport com.pacvue.commerce.common.base.ApiConsts;\nimport com.pacvue.commerce.common.base.BaseResponse;\nimport com.pacvue.commerce.common.base.BaseUser;\nimport com.pacvue.commerce.common.exception.BusinessException;\nimport com.pacvue.commerce.common.methods.Common
SyntaxError Unexpected end of JSON input
error stack:

• index.js Ge
/node_modules/code-review-gpt/dist/index.js:16
• index.js maxTry
/node_modules/code-review-gpt/dist/index.js:16
• task_queues process.processTicksAndRejections
internal/process/task_queues:95
ERROR Error in callModelJSON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant