Skip to content

Commit e71c0f1

Browse files
authored
Merge pull request #1586 from qodo-ai/tr/docs245
docs: add language configuration documentation and update changelog
2 parents 9a32e94 + 8182a4a commit e71c0f1

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ PR-Agent aims to help efficiently review and handle pull requests, by providing
5353
## News and Updates
5454

5555
### Feb 27, 2025
56-
57-
Important updates and bug fixes for Azure DevOps, see [here](https://github.com/qodo-ai/pr-agent/pull/1583)
56+
- Updated the default model to `o3-mini` for all tools. You can still use the `gpt-4o` as the default model by setting the `model` parameter in the configuration file.
57+
- Important updates and bug fixes for Azure DevOps, see [here](https://github.com/qodo-ai/pr-agent/pull/1583)
58+
- Added support for adjusting the [response language](https://qodo-merge-docs.qodo.ai/usage-guide/additional_configurations/#language-settings) of the PR-Agent tools.
5859

5960
### Feb 6, 2025
6061
New design for the `/improve` tool:

docs/docs/usage-guide/additional_configurations.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,22 @@ All Qodo Merge tools have a parameter called `extra_instructions`, that enables
5757
/update_changelog --pr_update_changelog.extra_instructions="Make sure to update also the version ..."
5858
```
5959

60-
## Localization
60+
## Language Settings
6161

6262
The default response language for Qodo Merge is **U.S. English**. However, some development teams may prefer to display information in a different language. For example, your team's workflow might improve if PR descriptions and code suggestions are set to your country's native language.
6363

6464
To configure this, set the `response_language` parameter in the configuration file. This will prompt the model to respond in the specified language. Use a **standard locale code** based on [ISO 3166](https://en.wikipedia.org/wiki/ISO_3166) (country codes) and [ISO 639](https://en.wikipedia.org/wiki/ISO_639) (language codes) to define a language-country pair. See this [comprehensive list of locale codes](https://simplelocalize.io/data/locales/).
6565

66-
### Example:
66+
Example:
6767

68-
```yaml
69-
response_language: "he-IL"
68+
```toml
69+
[config]
70+
response_language: "it-IT"
7071
```
7172

72-
This will set the response language globally for [describe](../tools/describe.md), [improve](../tools/improve.md), [add_docs](../tools/documentation.md), [update_changelog](../tools/update_changelog.md), [test](../tools/test.md) commands to Hebrew
73+
This will set the response language globally for all the commands to Italian.
7374

74-
> **Important:** Note that only dynamic text generated by the AI model is translated to the configured language. Static text such as labels and table headers that are not part of the AI modeles response will remain in US English.
75+
> **Important:** Note that only dynamic text generated by the AI model is translated to the configured language. Static text such as labels and table headers that are not part of the AI models response will remain in US English. In addition, the model you are using must have good support for the specified language.
7576
7677
## Working with large PRs
7778

pr_agent/agent/pr_agent.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,18 @@ async def handle_request(self, pr_url, request, notify=None) -> bool:
7474
args = update_settings_from_args(args)
7575

7676
# Append the response language in the extra instructions
77-
response_language = get_settings().config.response_language
78-
if response_language != 'en-us':
77+
response_language = get_settings().config.get('response_language', 'en-us')
78+
if response_language.lower() != 'en-us':
79+
get_logger().info(f'User has set the response language to: {response_language}')
7980
for key in get_settings():
8081
setting = get_settings().get(key)
8182
if str(type(setting)) == "<class 'dynaconf.utils.boxing.DynaBox'>":
8283
if hasattr(setting, 'extra_instructions'):
83-
extra_instructions = get_settings()[key.lower()].extra_instructions
84-
get_settings()[key.lower()].extra_instructions = f"{extra_instructions} \n======\n\nLanguage preference from the user\n======\n In your reply only use the lanaguage with locale code: {response_language}"
84+
current_extra_instructions = setting.extra_instructions
85+
if current_extra_instructions:
86+
setting.extra_instructions = current_extra_instructions+ f"\n======\n\nIn addition, Your response MUST be written in the language corresponding to local code: {response_language}. This is crucial."
87+
else:
88+
setting.extra_instructions = f"Your response MUST be written in the language corresponding to locale code: '{response_language}'. This is crucial."
8589

8690
action = action.lstrip("/").lower()
8791
if action not in command2class:

pr_agent/algo/ai_handlers/litellm_ai_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ async def chat_completion(self, model: str, system: str, user: str, temperature:
232232

233233
# Add temperature only if model supports it
234234
if model not in self.no_support_temperature_models and not get_settings().config.custom_reasoning_model:
235-
get_logger().info(f"Adding temperature with value {temperature} to model {model}.")
235+
# get_logger().info(f"Adding temperature with value {temperature} to model {model}.")
236236
kwargs["temperature"] = temperature
237237

238238
# Add reasoning_effort if model supports it

pr_agent/settings/configuration.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
# Important: This file contains all available configuration options.
2+
# Do not copy this entire file to your repository configuration.
3+
# Your repository configuration should only include options you wish to override from the defaults.
4+
15
[config]
26
# models
3-
model="gpt-4o-2024-11-20"
4-
fallback_models=["gpt-4o-2024-08-06"]
7+
model="o3-mini"
8+
fallback_models=["gpt-4o-2024-11-20"]
59
#model_weak="gpt-4o-mini-2024-07-18" # optional, a weaker model to use for some easier tasks
6-
response_language="en-US" # Language locales code for PR responses in ISO 3166 and ISO 639 format (e.g., "en-US", "es-ES", "he-IL", "ar-IL", "zh-CN")
10+
response_language="en-US" # Language locales code for PR responses in ISO 3166 and ISO 639 format (e.g., "en-US", "it-IT", "zh-CN", ...)
711
# CLI
812
git_provider="github"
913
publish_output=true

0 commit comments

Comments
 (0)