freeedcom / ai-codereviewer

AI Code Reviewer: Enhance your GitHub workflow with AI-powered code review! Get intelligent feedback and suggestions on pull requests using OpenAI's GPT-4 API, improving code quality and saving developers time.
MIT License
479 stars 439 forks source link

facing 404 error in https://api.openai.com/v1/chat/completions api , open api key is added in git hub secret , do i need to pay in open api #26

Open santosh-invt opened 8 months ago

santosh-invt commented 8 months ago

response: { status: 404, statusText: 'Not Found', headers: { date: 'Tue, 21 Nov 2023 11:45:46 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '291', connection: 'close', vary: 'Origin', 'x-request-id': '141863fc39006e4ba1b203cf094e8c86', 'strict-transport-security': 'max-age=15724800; includeSubDomains', 'cf-cache-status': 'DYNAMIC', 'set-cookie': [Array], server: 'cloudflare', 'cf-ray': '8298b03bfea90fe8-LAX', 'alt-svc': 'h3=":443"; ma=86400' }, config: { transitional: [Object], adapter: [Function: httpAdapter], transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], headers: [Object], method: 'post', data: '{"model":"gpt-4","temperature":0.2,"max_tokens":700,"top_p":1,"frequency_penalty":0,"presence_penalty":0,"messages":[{"role":"system","content":"Your task is to review pull requests. Instructions:\n- Provide the response in following JSON format: [{\"lineNumber\": , \"reviewComment\": \"\"}]\n- Do not give positive comments or compliments.\n- Provide comments and suggestions ONLY if there is something to improve, otherwise return an empty array.\n- Write the comment in GitHub Markdown format.\n- Use the given description only for the overall context and only comment the code.\n- IMPORTANT: NEVER suggest adding comments to the code.\n\nReview the following code diff in the file \".github/workflows/main.yml\" and take the pull request title and description into account when writing the response.\n \nPull request title: Development\nPull request description:\n\n---\n\n---\n\nGit diff to review:\n\ndiff\\n@@ -0,0 +1,22 @@\\n1 +name: AI Code Reviewer\\n2 +\\n3 +on:\\n4 + pull_request:\\n5 + types:\\n6 + - opened\\n7 + - synchronize\\n8 +permissions: write-all\\n9 +jobs:\\n10 + review:\\n11 + runs-on: ubuntu-latest\\n12 + steps:\\n13 + - name: Checkout Repo\\n14 + uses: actions/checkout@v3\\n15 +\\n16 + - name: AI Code Reviewer\\n17 + uses: santosh-invt/ai-code-reviewer@main\\n18 + with:\\n19 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\\n20 + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}\\n21 + OPENAI_API_MODEL: \\"gpt-3.5-turbo\\" # Optional: defaults to \\"gpt-4\\"\\n22 + exclude: \\"**/*.json, **/*.md\\" # Optional: exclude patterns separated by commas\\n22 \\\\ No newline at end of file\\n\n"}]}', url: 'https://api.openai.com/v1/chat/completions' }