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

language support #430

Merged
merged 6 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,14 @@

CodeRabbit `ai-pr-reviewer` is an open-source project built on AI, designed to
enhance developer productivity and efficiency by performing automated reviews of
pull requests.

# Professional Version of CodeRabbit

The professional version of our openai-pr-reviewer project is now live at
[coderabbit.ai](http://Coderabbit.ai). Building upon our open-source foundation,
CodeRabbit offers premium features including enhanced context and superior
noise reduction, dedicated support, and our ongoing commitment to improve code
reviews.

pull requests.

## Reviewer Features:

- **PR Summarization**: It generates a summary and release notes of the changes
in the pull request.
- **Line-by-line code change suggestions**: Reviews the changes line by line and
provides code change suggestions that can be directly committed from the
GitHub UI.
provides code change suggestions.
- **Continuous, incremental reviews**: Reviews are performed on each commit
within a pull request, rather than a one-time review on the entire pull
request.
Expand All @@ -56,7 +46,6 @@ configure the required environment variables, such as `GITHUB_TOKEN` and
`OPENAI_API_KEY`. For more information on usage, examples, contributing, and
FAQs, you can refer to the sections below.


- [Overview](#overview)
- [Professional Version of CodeRabbit](#professional-version-of-coderabbit)
- [Reviewer Features](#reviewer-features)
Expand All @@ -66,7 +55,13 @@ FAQs, you can refer to the sections below.
- [Contribute](#contribute)
- [FAQs](#faqs)

## Professional Version of CodeRabbit

The professional version of `openai-pr-reviewer` project is now available at
[coderabbit.ai](http://Coderabbit.ai). Building upon our open-source foundation,
CodeRabbit offers premium features including enhanced context and superior noise
reduction, dedicated support, and our ongoing commitment to improve code
reviews.
harjotgill marked this conversation as resolved.
Show resolved Hide resolved

## Install instructions

Expand Down Expand Up @@ -195,13 +190,10 @@ Some of the reviews done by ai-pr-reviewer

![PR Summary](./docs/images/PRSummary.png)


![PR Release Notes](./docs/images/ReleaseNotes.png)


![PR Review](./docs/images/section-1.png)


![PR Conversation](./docs/images/section-3.png)

Any suggestions or pull requests for improving the prompts are highly
Expand All @@ -212,7 +204,7 @@ appreciated.
### Developing

> First, you'll need to have a reasonably modern version of `node` handy, tested
> with node 16.
> with node 17+.
harjotgill marked this conversation as resolved.
Show resolved Hide resolved

Install the dependencies

Expand Down
42 changes: 38 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ inputs:
!**/*.gz
!**/*.xz
!**/*.zip
!**/*.7z
!**/*.rar
!**/*.zst
!**/*.ico
!**/*.jar
Expand All @@ -56,18 +58,41 @@ inputs:
!**/*.lo
!**/*.log
!**/*.mp3
!**/*.wav
!**/*.wma
!**/*.mp4
!**/*.avi
!**/*.mkv
!**/*.wmv
!**/*.m4a
!**/*.m4v
!**/*.3gp
!**/*.3g2
!**/*.rm
!**/*.mov
!**/*.flv
!**/*.iso
!**/*.swf
!**/*.flac
!**/*.nar
!**/*.o
!**/*.ogg
!**/*.otf
!**/*.p
!**/*.pdf
!**/*.doc
!**/*.docx
!**/*.xls
!**/*.xlsx
!**/*.ppt
!**/*.pptx
!**/*.pkl
!**/*.pickle
!**/*.pyc
!**/*.pyd
!**/*.pyo
!**/*.pub
!**/*.pem
!**/*.rkt
!**/*.so
!**/*.ss
Expand All @@ -91,17 +116,26 @@ inputs:
!**/*.jpg
!**/*.png
!**/*.gif
!**/*.bmp
!**/*.tiff
!**/*.webm
!**/*.woff
!**/*.woff2
!**/*.dot
!**/*.md5sum
!**/*.wasm
!**/*.snap
!**/*.parquet
!**/gen/**
!**/_gen/**
!**/generated/**
!**/@generated/**
!**/vendor/**
!**/*.min.js
!**/*.min.js.map
!**/*.min.js.css
!**/*.tfstate
!**/*.tfstate.backup
disable_review:
required: false
description: 'Only provide the summary and skip the code review.'
Expand Down Expand Up @@ -195,10 +229,10 @@ inputs:
"New Feature: An integrations page was added to the UI". Keep your
response within 50-100 words. Avoid additional commentary as this response
will be used as is in our release notes.

Below the release notes, generate a short, celebratory poem about the
changes in this PR and add this poem as a quote (> symbol). You can
use emojis in the poem, where they are relevant.
language:
required: false
description: ISO code for the response language
default: en-US
runs:
using: 'node16'
main: 'dist/index.js'
89 changes: 38 additions & 51 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export class Bot {
const currentDate = new Date().toISOString().split('T')[0]
const systemMessage = `${options.systemMessage}
Knowledge cutoff: ${openaiOptions.tokenLimits.knowledgeCutOff}
Current date: ${currentDate}`
Current date: ${currentDate}

IMPORTANT: Entire response must be in the language with ISO code: ${options.language}
`

this.api = new ChatGPTAPI({
apiBaseUrl: options.apiBaseUrl,
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ async function run(): Promise<void> {
getInput('openai_timeout_ms'),
getInput('openai_concurrency_limit'),
getInput('github_concurrency_limit'),
getInput('openai_base_url')
getInput('openai_base_url'),
getInput('language')
harjotgill marked this conversation as resolved.
Show resolved Hide resolved
)

// print options
Expand Down
Loading