coderabbitai / ai-pr-reviewer

AI-based Pull Request Summarizer and Reviewer with Chat Capabilities.
https://coderabbit.ai
MIT License
1.41k stars 256 forks source link

fix: azure #508

Closed nishihara-shinya closed 6 months ago

nishihara-shinya commented 6 months ago

Summary by CodeRabbit

github-actions[bot] commented 6 months ago

Image description CodeRabbit

Walkthrough

This pull request primarily refactors the interaction with the OpenAI API in the Bot class, updates the GitHub Actions workflow file, and removes some unnecessary code. It also adds a new package dependency. The changes aim to improve the maintainability and readability of the code.

Changes

File(s) Summary
.github/workflows/openai-review.yml Modifies the GitHub Actions workflow file, changing the event trigger and adding a condition to skip the workflow for dependabot[bot]. Updates environment variables related to Azure OpenAI API.
package.json Adds "langchain" as a new package dependency.
src/bot.ts Refactors the Bot class, replacing the api property with model and api properties. Updates the OpenAI API configuration to use Azure environment variables.
src/main.ts, src/options.ts Removes the openai_base_url input and the apiBaseUrl property from the Options class.
src/review-comment.ts, src/review.ts Simplifies the code by removing array destructuring and directly assigning responses from await calls to variables.

🐰💻

Code is like a garden, it needs care,

With each refactor, we show it our flair.

We prune, we trim, we add anew,

To make our codebase feel fresh and true.

So here's to changes, big and small,

May our code continue to enthrall! 🎉🥕


Uplevel your code reviews with CodeRabbit Pro ### CodeRabbit Pro If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.