Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

getting 404 resource not found error #382

Open
darshilshahquantive opened this issue Jul 25, 2023 · 8 comments
Open

getting 404 resource not found error #382

darshilshahquantive opened this issue Jul 25, 2023 · 8 comments

Comments

@darshilshahquantive
Copy link

darshilshahquantive commented Jul 25, 2023

using azure openai as openai_base_url?
i am trying to do it and getting this error :

response: undefined, failed to send message to openai: Error: OpenAI error 404: {"error":{"code":"404","message": "Resource not found"}}, backtrace: Error: OpenAI error 404: {"error":{"code":"404","message": "Resource not found"}}
at Promise.then.promptTokens (/actions-runner/_work/_actions/fluxninja/openai-pr-reviewer/latest/dist/index.js:3310:29)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

and this is how my workflow yaml looks like :

name: Code Review

permissions:
contents: read
pull-requests: write

on:
pull_request:
pull_request_review_comment:
types: [ created ]

concurrency:
group:
${{ github.repository }}-${{ github.event.number || github.head_ref ||
github.sha }}-${{ github.workflow }}-${{ github.event_name ==
'pull_request_review_comment' && 'pr_comment' || 'pr' }}
cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }}

jobs:
review:
runs-on: self-hosted
environment: new-env
steps:
- uses: fluxninja/openai-pr-reviewer@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
with:
debug: false
openai_base_url: https://"your endpoint deployment name".openai.azure.com/
openai_light_model: gpt-35-turbo
openai_heavy_model: gpt-35-turbo
@harjotgill
Copy link
Contributor

Model name looks incorrect. Try gpt-3.5-turbo

@darshilshahquantive
Copy link
Author

darshilshahquantive commented Jul 25, 2023

Tried same error , i tried this name as in azure openai services the model name deployed under this name

@darshilshahquantive
Copy link
Author

@harjotgill i got the issue now , basically we are using the chatgpt node package but to use azure/openai as a openai base URL we will need to add support for azure/openai node package as they both have different api's altogether

@dulalbert
Copy link

Azure OpenAi support can be added with this I guess : transitive-bullshit/agentic#352 (comment)

@harjotgill
Copy link
Contributor

If you folks fix it, please contribute back! Cheers!

@darshilshahquantive
Copy link
Author

Yes it works , i will push it with generalising the feature with paramas
https://github.com/darshilshahquantive/ai-pr-reviewer

@darinkishore
Copy link

darinkishore commented Aug 27, 2023

@darshilshahquantive Did you change anything typescript wise, or just index.js to get it working? This thing has been a huge pain in my butt these last couple weeks, so any help would be appreciated.

@darshilshahquantive
Copy link
Author

darshilshahquantive commented Aug 27, 2023

index.ts fix will work but if you want to use azure 3.5 turbo with 16 k context you have to edit limit.ts else it will use this much tokrn limit by default https://github.com/darshilshahquantive/ai-pr-reviewer/blob/10783d111ba827426dc67c38e809283ad18877ca/src/limits.ts#L21

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants