From 895dd07171bbea329cf49d4764bafa56a356d7e4 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Wed, 18 Oct 2023 01:30:44 +1100 Subject: [PATCH 01/59] update gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index f851dbab6..4aa0878ee 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ .venv/ env/ venv/ +ChatDev_conda_env/ +WareHouse/ \ No newline at end of file From a83262bf03fabd4e996abc481213964b55c97dfe Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Wed, 18 Oct 2023 02:23:24 +1100 Subject: [PATCH 02/59] Add workflow --- .github/workflows/translate.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/translate.yml diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml new file mode 100644 index 000000000..8be17597f --- /dev/null +++ b/.github/workflows/translate.yml @@ -0,0 +1,33 @@ +name: Translate README + +on: + push: + branches: + - automate-language + paths: + - 'README.md' + +jobs: + translate: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Translate README.md to Spanish + run: | + TEXT=$(cat README.md) + TRANSLATED_TEXT=$(curl -X POST "https://libretranslate.com/translate" \ + -H "Content-Type: application/json" \ + -d "{\"q\": \"$TEXT\", \"source\": \"en\", \"target\": \"es\"}" \ + | jq .translatedText) + echo "$TRANSLATED_TEXT" > README.es.md + + - name: Commit and push translated README + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add README.es.md + git commit -m "Add translated README.es.md" + git push From 7faed15dc2c9bd250e783a9feabdd670af11a237 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Wed, 18 Oct 2023 02:25:20 +1100 Subject: [PATCH 03/59] change to main --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 8be17597f..8d31e6a46 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -3,7 +3,7 @@ name: Translate README on: push: branches: - - automate-language + - main paths: - 'README.md' From 4170c59f8c30226a37a34e19605cc79b104a5435 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Wed, 18 Oct 2023 02:34:25 +1100 Subject: [PATCH 04/59] add manual dispatch --- .github/workflows/translate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 8d31e6a46..3febb4f31 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -6,6 +6,7 @@ on: - main paths: - 'README.md' + workflow_dispatch: jobs: translate: From 0aabeaaf05e4cba4f4e1119290e36d54d9933946 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 17 Oct 2023 15:35:35 +0000 Subject: [PATCH 05/59] Add translated README.es.md --- README.es.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.es.md diff --git a/README.es.md b/README.es.md new file mode 100644 index 000000000..19765bd50 --- /dev/null +++ b/README.es.md @@ -0,0 +1 @@ +null From 240f9ae5f73305b8b88d71b64eb905a0ee3e7620 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Wed, 18 Oct 2023 02:38:33 +1100 Subject: [PATCH 06/59] add debug --- .github/workflows/translate.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 3febb4f31..e8971e901 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -19,12 +19,14 @@ jobs: - name: Translate README.md to Spanish run: | TEXT=$(cat README.md) - TRANSLATED_TEXT=$(curl -X POST "https://libretranslate.com/translate" \ - -H "Content-Type: application/json" \ - -d "{\"q\": \"$TEXT\", \"source\": \"en\", \"target\": \"es\"}" \ - | jq .translatedText) + RESPONSE=$(curl -X POST "https://libretranslate.com/translate" \ + -H "Content-Type: application/json" \ + -d "{\"q\": \"$TEXT\", \"source\": \"en\", \"target\": \"es\"}") + echo "API Response: $RESPONSE" + TRANSLATED_TEXT=$(echo "$RESPONSE" | jq -r .translatedText) echo "$TRANSLATED_TEXT" > README.es.md + - name: Commit and push translated README run: | git config --local user.email "action@github.com" From 64102eb04579116901cbd8b68477bff05b33f24f Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Wed, 18 Oct 2023 02:46:10 +1100 Subject: [PATCH 07/59] attempt fix API call + dont translate links --- .github/workflows/translate.yml | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index e8971e901..281b5256b 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -16,17 +16,37 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Translate README.md to Spanish + - name: Translate README.md to Spanish without translating links run: | - TEXT=$(cat README.md) + # Step 1: Extract and Store Links + LINKS=($(grep -oP 'http(s)?://\S+' README.md)) + + # Step 2: Replace Links with Placeholders + MODIFIED_TEXT=$(cat README.md) + for i in "${!LINKS[@]}"; do + PLACEHOLDER="LINKPLACEHOLDER_$i" + MODIFIED_TEXT=${MODIFIED_TEXT/${LINKS[$i]}/$PLACEHOLDER} + done + + # Step 3: Translate the Modified Text RESPONSE=$(curl -X POST "https://libretranslate.com/translate" \ - -H "Content-Type: application/json" \ - -d "{\"q\": \"$TEXT\", \"source\": \"en\", \"target\": \"es\"}") - echo "API Response: $RESPONSE" + -F "q=$MODIFIED_TEXT" \ + -F "source=en" \ + -F "target=es" \ + -F "format=text") TRANSLATED_TEXT=$(echo "$RESPONSE" | jq -r .translatedText) + + # Step 4: Restore Links + for i in "${!LINKS[@]}"; do + PLACEHOLDER="LINKPLACEHOLDER_$i" + TRANSLATED_TEXT=${TRANSLATED_TEXT/$PLACEHOLDER/${LINKS[$i]}} + done + echo "$TRANSLATED_TEXT" > README.es.md + + - name: Commit and push translated README run: | git config --local user.email "action@github.com" From d1f0bf94f0fda30728a9c5b0323ef812e841e75c Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Wed, 18 Oct 2023 14:15:18 +1100 Subject: [PATCH 08/59] use file translate endpoint --- .github/workflows/translate.yml | 36 +++++++-------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 281b5256b..39f85e1cf 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -16,36 +16,14 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Translate README.md to Spanish without translating links + - name: Translate README.md to Spanish using the file endpoint run: | - # Step 1: Extract and Store Links - LINKS=($(grep -oP 'http(s)?://\S+' README.md)) - - # Step 2: Replace Links with Placeholders - MODIFIED_TEXT=$(cat README.md) - for i in "${!LINKS[@]}"; do - PLACEHOLDER="LINKPLACEHOLDER_$i" - MODIFIED_TEXT=${MODIFIED_TEXT/${LINKS[$i]}/$PLACEHOLDER} - done - - # Step 3: Translate the Modified Text - RESPONSE=$(curl -X POST "https://libretranslate.com/translate" \ - -F "q=$MODIFIED_TEXT" \ - -F "source=en" \ - -F "target=es" \ - -F "format=text") - TRANSLATED_TEXT=$(echo "$RESPONSE" | jq -r .translatedText) - - # Step 4: Restore Links - for i in "${!LINKS[@]}"; do - PLACEHOLDER="LINKPLACEHOLDER_$i" - TRANSLATED_TEXT=${TRANSLATED_TEXT/$PLACEHOLDER/${LINKS[$i]}} - done - - echo "$TRANSLATED_TEXT" > README.es.md - - - + curl -X POST "https://libretranslate.com/translate/file" \ + -F "file=@README.md" \ + -F "source=en" \ + -F "target=es" \ + -F "format=text" \ + -o README.es.md - name: Commit and push translated README run: | From b0f22195f20d3f76110d63c1f7677612480b6e0f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 18 Oct 2023 03:18:03 +0000 Subject: [PATCH 09/59] Add translated README.es.md --- README.es.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.es.md b/README.es.md index 19765bd50..affacdf57 100644 --- a/README.es.md +++ b/README.es.md @@ -1 +1,5 @@ -null + + +404 Not Found +

Not Found

+

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

From fad93d96be965dd7b2c994f51b622dabf7e8b499 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 19 Oct 2023 20:56:34 +1100 Subject: [PATCH 10/59] revert to text translation --- .github/workflows/translate.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 39f85e1cf..c15cea3ec 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -16,14 +16,15 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Translate README.md to Spanish using the file endpoint + - name: Translate README.md to Spanish run: | - curl -X POST "https://libretranslate.com/translate/file" \ - -F "file=@README.md" \ - -F "source=en" \ - -F "target=es" \ - -F "format=text" \ - -o README.es.md + TEXT=$(cat README.md) + TRANSLATED_TEXT=$(curl -X POST "https://libretranslate.com/translate" \ + -F "q=$TEXT" \ + -F "source=en" \ + -F "target=es" \ + -F "format=text" | jq -r .translatedText) + echo "$TRANSLATED_TEXT" > README.es.md - name: Commit and push translated README run: | From 4491efa78aacd5638a8fc11a8c0084c73cf1fb1d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 19 Oct 2023 09:59:14 +0000 Subject: [PATCH 11/59] Add translated README.es.md --- README.es.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.es.md b/README.es.md index affacdf57..19765bd50 100644 --- a/README.es.md +++ b/README.es.md @@ -1,5 +1 @@ - - -404 Not Found -

Not Found

-

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

+null From 0be1375f21fa706697f40b4992ac885ca5a9882a Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 19 Oct 2023 21:01:17 +1100 Subject: [PATCH 12/59] added debugging to translate --- .github/workflows/translate.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index c15cea3ec..bb94ba8dc 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -19,13 +19,16 @@ jobs: - name: Translate README.md to Spanish run: | TEXT=$(cat README.md) - TRANSLATED_TEXT=$(curl -X POST "https://libretranslate.com/translate" \ - -F "q=$TEXT" \ - -F "source=en" \ - -F "target=es" \ - -F "format=text" | jq -r .translatedText) + RESPONSE=$(curl -X POST "https://libretranslate.com/translate" \ + -F "q=$TEXT" \ + -F "source=en" \ + -F "target=es" \ + -F "format=text") + echo "Server Response: $RESPONSE" # This will print the server response for debugging + TRANSLATED_TEXT=$(echo "$RESPONSE" | jq -r .translatedText) echo "$TRANSLATED_TEXT" > README.es.md + - name: Commit and push translated README run: | git config --local user.email "action@github.com" From 5c10d560627fcecf30d21c4b23dfccef8fbe1870 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 20 Oct 2023 01:37:22 +1100 Subject: [PATCH 13/59] Translations using crowdin --- .github/workflows/translate.yml | 45 +++++++++++++-------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index bb94ba8dc..96dbfc352 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -1,38 +1,29 @@ -name: Translate README +name: Translate Readme on: push: - branches: - - main - paths: - - 'README.md' + branches: [ main ] workflow_dispatch: jobs: - translate: + translate-readme: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v3 - - name: Translate README.md to Spanish - run: | - TEXT=$(cat README.md) - RESPONSE=$(curl -X POST "https://libretranslate.com/translate" \ - -F "q=$TEXT" \ - -F "source=en" \ - -F "target=es" \ - -F "format=text") - echo "Server Response: $RESPONSE" # This will print the server response for debugging - TRANSLATED_TEXT=$(echo "$RESPONSE" | jq -r .translatedText) - echo "$TRANSLATED_TEXT" > README.es.md + - name: Translate Readme + uses: crowdin/translate-readme@v0.1.0 + env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - - name: Commit and push translated README - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add README.es.md - git commit -m "Add translated README.es.md" - git push + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + title: New Readme Translations by Crowdin + body: By [translate-readme](https://github.com/crowdin/translate-readme) GitHub action + commit-message: New Readme Translations + committer: Crowdin Bot + branch: docs/readme-translations From fab73488c254a676987fab3d911ed3ceef760bda Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 20 Oct 2023 02:12:26 +1100 Subject: [PATCH 14/59] added required permissions --- .github/workflows/translate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 96dbfc352..48d33a506 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -8,6 +8,9 @@ on: jobs: translate-readme: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - name: Checkout From fd6517e3d1a7d7251dcb172b43e79bbcdf500e2a Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 20 Oct 2023 02:32:53 +1100 Subject: [PATCH 15/59] Added pre-translate --- .github/workflows/translate.yml | 39 ++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 48d33a506..6138ae699 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -13,20 +13,29 @@ jobs: pull-requests: write steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - - name: Translate Readme - uses: crowdin/translate-readme@v0.1.0 - env: - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + - name: Translate Readme + uses: crowdin/translate-readme@v0.1.0 + env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - title: New Readme Translations by Crowdin - body: By [translate-readme](https://github.com/crowdin/translate-readme) GitHub action - commit-message: New Readme Translations - committer: Crowdin Bot - branch: docs/readme-translations + - name: Pre-Translate README.md via Translation Memory + uses: crowdin/github-action@v1 + with: + command: 'pre-translate' + command_args: '-l all --method mt' + env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + title: New Readme Translations by Crowdin + body: By [translate-readme](https://github.com/crowdin/translate-readme) GitHub action + commit-message: New Readme Translations + committer: Crowdin Bot + branch: docs/readme-translations From ef3bd2ae21a9cf0fd627af104266d0b72d794bc3 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Sun, 22 Oct 2023 04:53:08 +1100 Subject: [PATCH 16/59] Switched to using DeepL --- .github/workflows/translate.yml | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 6138ae699..b3e9df133 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -13,29 +13,29 @@ jobs: pull-requests: write steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - - name: Translate Readme - uses: crowdin/translate-readme@v0.1.0 - env: - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 - - name: Pre-Translate README.md via Translation Memory - uses: crowdin/github-action@v1 - with: - command: 'pre-translate' - command_args: '-l all --method mt' - env: - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install requests - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - title: New Readme Translations by Crowdin - body: By [translate-readme](https://github.com/crowdin/translate-readme) GitHub action - commit-message: New Readme Translations - committer: Crowdin Bot - branch: docs/readme-translations + - name: Translate Readme + run: python .github/scripts/translate_readme.py + env: + DEEPL_AUTH_KEY: ${{ secrets.DEEPL_AUTH_KEY }} + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + title: New Readme Translations by DeepL + body: By GitHub action using DeepL API + commit-message: New Readme Translations + committer: GitHub + branch: docs/readme-translations From b21d614034388b862080adcfab18806aa5a02497 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Sun, 22 Oct 2023 23:55:32 +1100 Subject: [PATCH 17/59] Added translate py file --- .github/translate_readme.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/translate_readme.py diff --git a/.github/translate_readme.py b/.github/translate_readme.py new file mode 100644 index 000000000..9305c7de1 --- /dev/null +++ b/.github/translate_readme.py @@ -0,0 +1,34 @@ +import requests +import json + +def translate_text(text, target_lang): + url = 'https://api-free.deepl.com/v2/translate' + headers = { + 'Authorization': 'DeepL-Auth-Key YOUR_DEEPL_AUTH_KEY', + 'Content-Type': 'application/json', + } + data = { + 'text': [text], + 'target_lang': target_lang, + } + response = requests.post(url, headers=headers, json=data) + if response.status_code == 200: + translations = response.json().get('translations', []) + if translations: + return translations[0].get('text', '') + return None + +def main(): + with open('README.md', 'r', encoding='utf-8') as file: + content = file.read() + + translated_content = translate_text(content, 'DE') # Translate to German + + if translated_content: + with open('README_DE.md', 'w', encoding='utf-8') as file: + file.write(translated_content) + else: + print('Translation failed.') + +if __name__ == '__main__': + main() From 5f5596b5d12fa4feaddb169a2db5e216ec57cb2b Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 00:38:15 +1100 Subject: [PATCH 18/59] Change to google translate --- .github/translate_readme.py | 34 ------------------------ .github/workflows/translate.yml | 47 ++++++++++----------------------- 2 files changed, 14 insertions(+), 67 deletions(-) delete mode 100644 .github/translate_readme.py diff --git a/.github/translate_readme.py b/.github/translate_readme.py deleted file mode 100644 index 9305c7de1..000000000 --- a/.github/translate_readme.py +++ /dev/null @@ -1,34 +0,0 @@ -import requests -import json - -def translate_text(text, target_lang): - url = 'https://api-free.deepl.com/v2/translate' - headers = { - 'Authorization': 'DeepL-Auth-Key YOUR_DEEPL_AUTH_KEY', - 'Content-Type': 'application/json', - } - data = { - 'text': [text], - 'target_lang': target_lang, - } - response = requests.post(url, headers=headers, json=data) - if response.status_code == 200: - translations = response.json().get('translations', []) - if translations: - return translations[0].get('text', '') - return None - -def main(): - with open('README.md', 'r', encoding='utf-8') as file: - content = file.read() - - translated_content = translate_text(content, 'DE') # Translate to German - - if translated_content: - with open('README_DE.md', 'w', encoding='utf-8') as file: - file.write(translated_content) - else: - print('Translation failed.') - -if __name__ == '__main__': - main() diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index b3e9df133..98c04b95b 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -2,40 +2,21 @@ name: Translate Readme on: push: - branches: [ main ] - workflow_dispatch: + branches: + - main + - master jobs: - translate-readme: + build: runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install requests - - - name: Translate Readme - run: python .github/scripts/translate_readme.py - env: - DEEPL_AUTH_KEY: ${{ secrets.DEEPL_AUTH_KEY }} - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - title: New Readme Translations by DeepL - body: By GitHub action using DeepL API - commit-message: New Readme Translations - committer: GitHub - branch: docs/readme-translations + - uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Adding License + uses: dephraiim/translate-readme@v1 + with: + LANG: zh-CN # Simplified Chinese + # Change the language to your specified language. From e208188ea1b73948128cb09831dce508c7894198 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 17:43:35 +1100 Subject: [PATCH 19/59] Test crowdin integration --- .github/workflows/translate.yml | 39 +++++++++++++++++++++++++++++++++ crowdin.yml | 20 +++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/translate.yml create mode 100644 crowdin.yml diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml new file mode 100644 index 000000000..04a2e362c --- /dev/null +++ b/.github/workflows/translate.yml @@ -0,0 +1,39 @@ +name: Translate Readme + +on: + push: + branches: [ master ] + paths: + - 'readme.md' + +jobs: + synchronize-with-crowdin: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: crowdin action + uses: crowdin/github-action@v1 + with: + # Upload sources to Crowdin + upload_sources: true + # Upload translations to Crowdin, only use true at initial run + upload_translations: true + # Download translations from Crowdin + download_translations: true + # To the specified branch + localization_branch_name: l10n_crowdin_translations + # Create pull request after pushing to branch + create_pull_request: true + pull_request_title: 'New Crowdin Translations' + pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)' + pull_request_base_branch_name: 'master' + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 000000000..437d94edd --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,20 @@ +"project_id_env": "CROWDIN_PROJECT_ID" +"api_token_env": "CROWDIN_PERSONAL_TOKEN" +"base_path": "." + +"preserve_hierarchy": true + +"files": [ + { + "source": "readme.md", + "translation": "readme_%two_letters_code%.md", + "languages_mapping": { + "two_letters_code": { + "pt-BR": "pt-BR", + "zh-CN": "cn", + "ne-NP": "np", + "ko": "kr" + } + } + } +] \ No newline at end of file From 8172b37457ebeb4b99d31d950faf85ff1bd13898 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 17:49:40 +1100 Subject: [PATCH 20/59] on push test --- .github/workflows/translate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index f8fd6ab9f..165f89283 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -5,7 +5,6 @@ on: branches: [ master ] paths: - 'readme.md' - jobs: synchronize-with-crowdin: runs-on: ubuntu-latest From 05a1dc5d585f648479f2d05c762c8f72f37cae59 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 17:50:46 +1100 Subject: [PATCH 21/59] add workflow dispatch --- .github/workflows/translate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 165f89283..3537ade75 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -5,6 +5,7 @@ on: branches: [ master ] paths: - 'readme.md' + workflow_dispatch: jobs: synchronize-with-crowdin: runs-on: ubuntu-latest From 66d7a1091ea58a9d4e9977084bd361d8613491a3 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 17:56:01 +1100 Subject: [PATCH 22/59] capitalize readme --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 3537ade75..3de1cff55 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -4,7 +4,7 @@ on: push: branches: [ master ] paths: - - 'readme.md' + - 'README.md' workflow_dispatch: jobs: synchronize-with-crowdin: From 1aedbccfe4a993a25d71b8bddca76c65ea0d6fd4 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 18:01:35 +1100 Subject: [PATCH 23/59] Update config --- .github/workflows/translate.yml | 1 + README.es.md | 1 - crowdin.yml | 18 ++++++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) delete mode 100644 README.es.md diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 3de1cff55..4b12c6d77 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -6,6 +6,7 @@ on: paths: - 'README.md' workflow_dispatch: + jobs: synchronize-with-crowdin: runs-on: ubuntu-latest diff --git a/README.es.md b/README.es.md deleted file mode 100644 index 19765bd50..000000000 --- a/README.es.md +++ /dev/null @@ -1 +0,0 @@ -null diff --git a/crowdin.yml b/crowdin.yml index 437d94edd..d0891b15e 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -6,14 +6,20 @@ "files": [ { - "source": "readme.md", - "translation": "readme_%two_letters_code%.md", + "source": "README.md", + "translation": "readme/README_%two_letters_code%.md", "languages_mapping": { "two_letters_code": { - "pt-BR": "pt-BR", - "zh-CN": "cn", - "ne-NP": "np", - "ko": "kr" + "zh-CN": "Chinese Simplified", + "nl": "Dutch", + "tl": "Filipino", + "fr": "French", + "hi": "Hindi", + "ja": "Japanese", + "ko": "Korean", + "pt-BR": "Portuguese", + "sk": "Slovak", + "es": "Spanish" } } } From 6b6b14aca2a93df3702b6723db6d1a2392e65eef Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 18:05:37 +1100 Subject: [PATCH 24/59] Fix github token --- .github/workflows/translate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 4b12c6d77..f0d1a4e4b 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -6,7 +6,7 @@ on: paths: - 'README.md' workflow_dispatch: - + jobs: synchronize-with-crowdin: runs-on: ubuntu-latest @@ -35,6 +35,6 @@ jobs: pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)' pull_request_base_branch_name: 'master' env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} From 19a2c284df3f7ff0745ea9fc240d00aaecbed153 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 18:08:42 +1100 Subject: [PATCH 25/59] change to PR to main --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index f0d1a4e4b..403c34d58 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -33,7 +33,7 @@ jobs: create_pull_request: true pull_request_title: 'New Crowdin Translations' pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)' - pull_request_base_branch_name: 'master' + pull_request_base_branch_name: 'main' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From c5413ee82d2a15d77359a4c5d365f7e38b9ab9ef Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 18:08:55 +1100 Subject: [PATCH 26/59] change to main --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 403c34d58..878ed7aae 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -2,7 +2,7 @@ name: Translate Readme on: push: - branches: [ master ] + branches: [ main ] paths: - 'README.md' workflow_dispatch: From 6f06ed85447b1e014eda25ec74f0f46233f8519a Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 18:11:03 +1100 Subject: [PATCH 27/59] change the mapping --- crowdin.yml | 4 ++-- readme/{README-Chinese.md => README-Chinese Simplified.md} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename readme/{README-Chinese.md => README-Chinese Simplified.md} (100%) diff --git a/crowdin.yml b/crowdin.yml index d0891b15e..60bd253cf 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -7,9 +7,9 @@ "files": [ { "source": "README.md", - "translation": "readme/README_%two_letters_code%.md", + "translation": "readme/README-%mapping%.md", "languages_mapping": { - "two_letters_code": { + "mapping": { "zh-CN": "Chinese Simplified", "nl": "Dutch", "tl": "Filipino", diff --git a/readme/README-Chinese.md b/readme/README-Chinese Simplified.md similarity index 100% rename from readme/README-Chinese.md rename to readme/README-Chinese Simplified.md From 1d68795beaf494e45fcec68bfae75eda2d93d890 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 18:12:37 +1100 Subject: [PATCH 28/59] fix translations --- crowdin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crowdin.yml b/crowdin.yml index 60bd253cf..b546455af 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -7,9 +7,9 @@ "files": [ { "source": "README.md", - "translation": "readme/README-%mapping%.md", + "translation": "readme/README-%two_letters_code%.md", "languages_mapping": { - "mapping": { + "two_letters_code": { "zh-CN": "Chinese Simplified", "nl": "Dutch", "tl": "Filipino", From 8fda0ede32927ee044eba4251f4754f3485a9271 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 19:45:46 +1100 Subject: [PATCH 29/59] test on readme change --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index cf15db888..56b10745d 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ To get started, follow these steps: ``` git clone https://github.com/OpenBMB/ChatDev.git ``` + 2. **Set Up Python Environment:** Ensure you have a version 3.9 or higher Python environment. You can create and activate this environment using the following commands, replacing `ChatDev_conda_env` with your preferred environment name: @@ -71,11 +72,13 @@ To get started, follow these steps: conda create -n ChatDev_conda_env python=3.9 -y conda activate ChatDev_conda_env ``` + 3. **Install Dependencies:** Move into the `ChatDev` directory and install the necessary dependencies by running: ``` cd ChatDev pip3 install -r requirements.txt ``` + 4. **Set OpenAI API Key:** Export your OpenAI API key as an environment variable. Replace `"your_OpenAI_API_key"` with your actual API key. Remember that this environment variable is session-specific, so you need to set it again if you open a new terminal session. @@ -87,6 +90,7 @@ To get started, follow these steps: ``` $env:OPENAI_API_KEY="your_OpenAI_API_key" ``` + 5. **Build Your Software:** Use the following command to initiate the building of your software, replacing `[description_of_your_idea]` with your idea's description and `[project_name]` with your desired project name: @@ -98,6 +102,7 @@ To get started, follow these steps: ``` python run.py --task "[description_of_your_idea]" --name "[project_name]" ``` + 6. **Run Your Software:** Once generated, you can find your software in the `WareHouse` directory under a specific project folder, such as `project_name_DefaultOrganization_timestamp`. Run your software using the following command within that directory: From 3d7c046eaf23d7104ae59bb8770e2ff8fe78bed6 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 19:51:57 +1100 Subject: [PATCH 30/59] test read me merge --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 56b10745d..cf15db888 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,6 @@ To get started, follow these steps: ``` git clone https://github.com/OpenBMB/ChatDev.git ``` - 2. **Set Up Python Environment:** Ensure you have a version 3.9 or higher Python environment. You can create and activate this environment using the following commands, replacing `ChatDev_conda_env` with your preferred environment name: @@ -72,13 +71,11 @@ To get started, follow these steps: conda create -n ChatDev_conda_env python=3.9 -y conda activate ChatDev_conda_env ``` - 3. **Install Dependencies:** Move into the `ChatDev` directory and install the necessary dependencies by running: ``` cd ChatDev pip3 install -r requirements.txt ``` - 4. **Set OpenAI API Key:** Export your OpenAI API key as an environment variable. Replace `"your_OpenAI_API_key"` with your actual API key. Remember that this environment variable is session-specific, so you need to set it again if you open a new terminal session. @@ -90,7 +87,6 @@ To get started, follow these steps: ``` $env:OPENAI_API_KEY="your_OpenAI_API_key" ``` - 5. **Build Your Software:** Use the following command to initiate the building of your software, replacing `[description_of_your_idea]` with your idea's description and `[project_name]` with your desired project name: @@ -102,7 +98,6 @@ To get started, follow these steps: ``` python run.py --task "[description_of_your_idea]" --name "[project_name]" ``` - 6. **Run Your Software:** Once generated, you can find your software in the `WareHouse` directory under a specific project folder, such as `project_name_DefaultOrganization_timestamp`. Run your software using the following command within that directory: From dd1c6d294c304b12668dcf13bf3308cbec6f3a90 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 19:54:49 +1100 Subject: [PATCH 31/59] added on merge --- .github/workflows/translate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 878ed7aae..965efd84a 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -5,6 +5,10 @@ on: branches: [ main ] paths: - 'README.md' + pull_request: + branches: [ main ] + paths: + - 'README.md' workflow_dispatch: jobs: From 628c15800e5e3a77a7deba8ab2cd9ef5384f3a3d Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 20:12:33 +1100 Subject: [PATCH 32/59] update filename mappings --- crowdin.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crowdin.yml b/crowdin.yml index b546455af..155ea3eb8 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -17,9 +17,14 @@ "hi": "Hindi", "ja": "Japanese", "ko": "Korean", - "pt-BR": "Portuguese", "sk": "Slovak", - "es": "Spanish" + "es": "Spanish", + "ar": Arabic, + "pt": Portuguese, + "ru", "Russian", + "sv": "Swedish", + "de": "German", + "es-ES": "Spanish" } } } From 1f3ac5c5c54d2320cbf4a270344db4ea7624a5cc Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 20:23:33 +1100 Subject: [PATCH 33/59] change --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index cf15db888..805fceb2a 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,6 @@ Made with [contrib.rocks](https://contrib.rocks). primaryClass={cs.SE} } ``` - ## ⚖️ License - Source Code Licensing: Our project's source code is licensed under the Apache 2.0 License. This license permits the use, modification, and distribution of the code, subject to certain conditions outlined in the Apache 2.0 License. From 6ce7e47a85b35171c6a7e08af1dcea86855f342d Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 20:49:18 +1100 Subject: [PATCH 34/59] add MT --- .github/workflows/translate.yml | 36 ++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 965efd84a..ee6100374 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -22,18 +22,40 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: crowdin action + - name: Upload to Crowdin uses: crowdin/github-action@v1 with: - # Upload sources to Crowdin + command: 'upload' upload_sources: true - # Upload translations to Crowdin, only use true at initial run - upload_translations: true - # Download translations from Crowdin + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Apply Machine Translation + uses: crowdin/github-action@v1 + with: + command: 'pre-translate' + command_args: '-l us --method mt --branch main' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Download from Crowdin + uses: crowdin/github-action@v1 + with: + command: 'download' download_translations: true - # To the specified branch localization_branch_name: l10n_crowdin_translations - # Create pull request after pushing to branch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Create PR with new translations + uses: crowdin/github-action@v1 + with: create_pull_request: true pull_request_title: 'New Crowdin Translations' pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)' From 7ab56389f11a4a1fd74fb819fb1e5f370ae1eb5c Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 20:56:53 +1100 Subject: [PATCH 35/59] add engine id --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index ee6100374..5cf5670c8 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l us --method mt --branch main' + command_args: '-l us --method mt --branch main --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From e1a9f0468abc574cd70d526b8764f23ea86e6f95 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:01:07 +1100 Subject: [PATCH 36/59] add all lang --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 5cf5670c8..ddb9471ca 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l us --method mt --branch main --engine-id 409836' + command_args: '--method mt --branch main --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From 4675b76d2256cb64a9f5ed917326ff20fafcf8f6 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:15:36 +1100 Subject: [PATCH 37/59] removed branch --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index ddb9471ca..a4bb26142 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '--method mt --branch main --engine-id 409836' + command_args: '--method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From fcb60f54d0260f18677bb8b47c005561a184a2d8 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:37:06 +1100 Subject: [PATCH 38/59] added all --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index a4bb26142..ba17601bf 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '--method mt --engine-id 409836' + command_args: '-l ALL --method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From 131b4cf990439f87e7afe126ef21a2a8f834f32b Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:38:32 +1100 Subject: [PATCH 39/59] test for ar --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index ba17601bf..19c77f055 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l ALL --method mt --engine-id 409836' + command_args: '-l ar --method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From 212af9fced7cc5f6ed4f44c409cb5cc5d3306113 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:45:07 +1100 Subject: [PATCH 40/59] Added langs to translate --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 19c77f055..de6aee22b 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l ar --method mt --engine-id 409836' + command_args: '-l zh-CN,nl,fr,ja,ko,es,ar,pt,ru,sv,de,es-ES --method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From 8279ae68f4826360be265c27978af8c4d3e32218 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:46:39 +1100 Subject: [PATCH 41/59] fixed workflow langs --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index de6aee22b..6082618ed 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l zh-CN,nl,fr,ja,ko,es,ar,pt,ru,sv,de,es-ES --method mt --engine-id 409836' + command_args: '-l zh-CN nl fr ja ko es ar pt ru sv de es-ES --method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From 685602bf388af873f61a89a1fdea44352a3bb59f Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:48:26 +1100 Subject: [PATCH 42/59] revert git ignore changes --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4aa0878ee..739776491 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,4 @@ .env/ .venv/ env/ -venv/ -ChatDev_conda_env/ -WareHouse/ \ No newline at end of file +venv/ \ No newline at end of file From 8ff6809b7e6faacb809b1900b39f58cbed8e4880 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:51:21 +1100 Subject: [PATCH 43/59] revert unrelated changes --- .gitignore | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 739776491..f851dbab6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ .env/ .venv/ env/ -venv/ \ No newline at end of file +venv/ diff --git a/README.md b/README.md index 805fceb2a..cf15db888 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,7 @@ Made with [contrib.rocks](https://contrib.rocks). primaryClass={cs.SE} } ``` + ## ⚖️ License - Source Code Licensing: Our project's source code is licensed under the Apache 2.0 License. This license permits the use, modification, and distribution of the code, subject to certain conditions outlined in the Apache 2.0 License. From 50ee17e84a6a6d9ef97ce279321082aaef6dcf1c Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:54:04 +1100 Subject: [PATCH 44/59] removed unsupported crowdin langs --- crowdin.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/crowdin.yml b/crowdin.yml index 155ea3eb8..0be15a171 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -12,12 +12,9 @@ "two_letters_code": { "zh-CN": "Chinese Simplified", "nl": "Dutch", - "tl": "Filipino", "fr": "French", - "hi": "Hindi", "ja": "Japanese", "ko": "Korean", - "sk": "Slovak", "es": "Spanish", "ar": Arabic, "pt": Portuguese, From 007d0e01824a578f4b4421c0a4065cf2511557dd Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 21:55:40 +1100 Subject: [PATCH 45/59] add -l? for multiple langs? --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 6082618ed..b5fd0777d 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l zh-CN nl fr ja ko es ar pt ru sv de es-ES --method mt --engine-id 409836' + command_args: '-l zh-CN -l nl -l fr -l ja -l ko -l es -l ar -l pt -l ru -l sv -l de -l es-ES --method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From 5f2c8018a9c03ab4e1048148c11a6da7391dc6bb Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 22:03:14 +1100 Subject: [PATCH 46/59] changed to two code --- .github/workflows/translate.yml | 2 +- crowdin.yml | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index b5fd0777d..d4d0cfaf9 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l zh-CN -l nl -l fr -l ja -l ko -l es -l ar -l pt -l ru -l sv -l de -l es-ES --method mt --engine-id 409836' + command_args: '-l zh-CN -l nl -l fr -l ja -l ko -l ar -l pt -l ru -l sv -l de -l es-ES --method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} diff --git a/crowdin.yml b/crowdin.yml index 0be15a171..7ccd9489c 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -8,21 +8,21 @@ { "source": "README.md", "translation": "readme/README-%two_letters_code%.md", - "languages_mapping": { - "two_letters_code": { - "zh-CN": "Chinese Simplified", - "nl": "Dutch", - "fr": "French", - "ja": "Japanese", - "ko": "Korean", - "es": "Spanish", - "ar": Arabic, - "pt": Portuguese, - "ru", "Russian", - "sv": "Swedish", - "de": "German", - "es-ES": "Spanish" + "languages_mapping": { + "two_letters_code": { + "zh-CN": "cn", + "nl": "nl", + "fr": "fr", + "ja": "ja", + "ko": "ko", + "es": "es", + "ar": "ar", + "pt": "pt", + "ru": "ru", + "sv": "sv", + "de": "de", + "es-ES": "es" + } } - } } ] \ No newline at end of file From 23e234f27ccffde07e9c637642777f8f0031acc0 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 22:09:40 +1100 Subject: [PATCH 47/59] changed swedish & portuguese --- .github/workflows/translate.yml | 2 +- crowdin.yml | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index d4d0cfaf9..0697be80f 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l zh-CN -l nl -l fr -l ja -l ko -l ar -l pt -l ru -l sv -l de -l es-ES --method mt --engine-id 409836' + command_args: '-l zh-CN -l nl -l fr -l ja -l ko -l ar -l pt-PT -l ru -l sv-SE -l de -l es-ES --method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} diff --git a/crowdin.yml b/crowdin.yml index 7ccd9489c..1b7ee2d24 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -8,21 +8,21 @@ { "source": "README.md", "translation": "readme/README-%two_letters_code%.md", - "languages_mapping": { - "two_letters_code": { - "zh-CN": "cn", - "nl": "nl", - "fr": "fr", - "ja": "ja", - "ko": "ko", - "es": "es", - "ar": "ar", - "pt": "pt", - "ru": "ru", - "sv": "sv", - "de": "de", - "es-ES": "es" - } + "languages_mapping": { + "two_letters_code": { + "zh-CN": "Chinese Simplified", + "nl": "Dutch", + "fr": "French", + "ja": "Japanese", + "ko": "Korean", + "es": "Spanish", + "ar": Arabic, + "pt-PT": Portuguese, + "ru", "Russian", + "sv-SE": "Swedish", + "de": "German", + "es-ES": "Spanish" } + } } ] \ No newline at end of file From b24364c48e499e34c93ffb755efddee4906a0d2f Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 22:12:13 +1100 Subject: [PATCH 48/59] removed portugese and swedish --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 0697be80f..7ab5857ef 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l zh-CN -l nl -l fr -l ja -l ko -l ar -l pt-PT -l ru -l sv-SE -l de -l es-ES --method mt --engine-id 409836' + command_args: '-l zh-CN -l nl -l fr -l ja -l ko -l ar -l ru -l de -l es-ES --method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From e2ac5f21cb41b60f41d912723d7af7c4796a155a Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 22:14:19 +1100 Subject: [PATCH 49/59] learnt that korean was the problem, not the others --- .github/workflows/translate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 7ab5857ef..11c970588 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -36,7 +36,7 @@ jobs: uses: crowdin/github-action@v1 with: command: 'pre-translate' - command_args: '-l zh-CN -l nl -l fr -l ja -l ko -l ar -l ru -l de -l es-ES --method mt --engine-id 409836' + command_args: '-l zh-CN -l nl -l fr -l ja -l ar -l pt-PT -l ru -l sv-SE -l de -l es-ES --method mt --engine-id 409836' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} From a4454c59e450edc04afe30dff31b631009e224a4 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 22:27:04 +1100 Subject: [PATCH 50/59] test translation --- README.md | 197 +----------------------------------------------------- 1 file changed, 1 insertion(+), 196 deletions(-) diff --git a/README.md b/README.md index cf15db888..b455af910 100644 --- a/README.md +++ b/README.md @@ -1,196 +1 @@ -# Communicative Agents for Software Development - -

- -

- -

- 【English | Chinese | Japanese | Korean | Filipino | French | Slovak | Portuguese | Spanish | Dutch | Hindi】 -

-

- 【📚 Wiki | 🚀 Local Demo | 👥 Community Built Software | 🔧 Customization】 -

- -## 📖 Overview - -- **ChatDev** stands as a **virtual software company** that operates through various **intelligent agents** holding - different roles, including Chief Executive Officer , Chief Product Officer , Chief Technology Officer , programmer , reviewer , tester , art designer . These - agents form a multi-agent organizational structure and are united by a mission to "revolutionize the digital world - through programming." The agents within ChatDev **collaborate** by participating in specialized functional seminars, - including tasks such as designing, coding, testing, and documenting. -- The primary objective of ChatDev is to offer an **easy-to-use**, **highly customizable** and **extendable** framework, - which is based on large language models (LLMs) and serves as an ideal scenario for studying collective intelligence. -

- -

- -## 🎉 News - -* **October 26th, 2023: ChatDev is now supported with Docker for safe execution** (thanks to contribution from [ManindraDeMel](https://github.com/ManindraDeMel)). Please see [Docker Start Guide](wiki.md#docker-start). -

- -

-* September 25th, 2023: The **Git** mode is now available, enabling the programmer to utilize Git for version control. To enable this feature, simply set ``"git_management"`` to ``"True"`` in ``ChatChainConfig.json``. See [guide](wiki.md#git-mode). -

- -

-* September 20th, 2023: The **Human-Agent-Interaction** mode is now available! You can get involved with the ChatDev team by playing the role of reviewer and making suggestions to the programmer ; - try ``python3 run.py --task [description_of_your_idea] --config "Human"``. See [guide](wiki.md#human-agent-interaction) and [example](WareHouse/Gomoku_HumanAgentInteraction_20230920135038). -

- -

-* September 1st, 2023: The **Art** mode is available now! You can activate the designer agent to generate images used in the software; - try ``python3 run.py --task [description_of_your_idea] --config "Art"``. See [guide](wiki.md#art) and [example](WareHouse/gomokugameArtExample_THUNLP_20230831122822). -* August 28th, 2023: The system is publicly available. -* August 17th, 2023: The v1.0.0 version was ready for release. -* July 30th, 2023: Users can customize ChatChain, Phase, and Role settings. Additionally, both online Log mode and replay - mode are now supported. -* July 16th, 2023: The [preprint paper](https://arxiv.org/abs/2307.07924) associated with this project was published. -* June 30th, 2023: The initial version of the ChatDev repository was released. - -## ❓ What Can ChatDev Do? - -![intro](misc/intro.png) - -https://github.com/OpenBMB/ChatDev/assets/11889052/80d01d2f-677b-4399-ad8b-f7af9bb62b72 - -## ⚡️ Quickstart - -### 🖥️ Quickstart with terminal - -To get started, follow these steps: - -1. **Clone the GitHub Repository:** Begin by cloning the repository using the command: - ``` - git clone https://github.com/OpenBMB/ChatDev.git - ``` -2. **Set Up Python Environment:** Ensure you have a version 3.9 or higher Python environment. You can create and - activate this environment using the following commands, replacing `ChatDev_conda_env` with your preferred environment - name: - ``` - conda create -n ChatDev_conda_env python=3.9 -y - conda activate ChatDev_conda_env - ``` -3. **Install Dependencies:** Move into the `ChatDev` directory and install the necessary dependencies by running: - ``` - cd ChatDev - pip3 install -r requirements.txt - ``` -4. **Set OpenAI API Key:** Export your OpenAI API key as an environment variable. Replace `"your_OpenAI_API_key"` with - your actual API key. Remember that this environment variable is session-specific, so you need to set it again if you - open a new terminal session. - On Unix/Linux: - ``` - export OPENAI_API_KEY="your_OpenAI_API_key" - ``` - On Windows: - ``` - $env:OPENAI_API_KEY="your_OpenAI_API_key" - ``` -5. **Build Your Software:** Use the following command to initiate the building of your software, - replacing `[description_of_your_idea]` with your idea's description and `[project_name]` with your desired project - name: - On Unix/Linux: - ``` - python3 run.py --task "[description_of_your_idea]" --name "[project_name]" - ``` - On Windows: - ``` - python run.py --task "[description_of_your_idea]" --name "[project_name]" - ``` -6. **Run Your Software:** Once generated, you can find your software in the `WareHouse` directory under a specific - project folder, such as `project_name_DefaultOrganization_timestamp`. Run your software using the following command - within that directory: - On Unix/Linux: - ``` - cd WareHouse/project_name_DefaultOrganization_timestamp - python3 main.py - ``` - On Windows: - ``` - cd WareHouse/project_name_DefaultOrganization_timestamp - python main.py - ``` - -### 🐳 Quickstart with Docker -- We thank [ManindraDeMel](https://github.com/ManindraDeMel) for providing Docker support. Please see [Docker Start Guide](wiki.md#docker-start). - -## ✨️ Advanced Skills - -For more detailed information, please refer to our [Wiki](wiki.md), where you can find: - -- An introduction to all command run parameters. -- A straightforward guide for setting up a local web demo, which includes enhanced visualized logs, a replay demo, and a - simple ChatChain Visualizer. -- An overview of the ChatDev framework. -- A comprehensive introduction to all advanced parameters in ChatChain configuration. -- Guides for customizing ChatDev, including: - - ChatChain: Design your own software development process (or any other process), such - as ``DemandAnalysis -> Coding -> Testing -> Manual``. - - Phase: Design your own phase within ChatChain, like ``DemandAnalysis``. - - Role: Defining the various agents in your company, such as the ``Chief Executive Officer``. - -## 🤗 Share Your Software! - -**Code**: We are enthusiastic about your interest in participating in our open-source project. If you come across any -problems, don't hesitate to report them. Feel free to create a pull request if you have any inquiries or if you are -prepared to share your work with us! Your contributions are highly valued. Please let me know if there's anything else -you need assistance! - -**Company**: Creating your own customized "ChatDev Company" is a breeze. This personalized setup involves three simple -configuration JSON files. Check out the example provided in the ``CompanyConfig/Default`` directory. For detailed -instructions on customization, refer to our [Wiki](wiki.md). - -**Software**: Whenever you develop software using ChatDev, a corresponding folder is generated containing all the -essential information. Sharing your work with us is as simple as making a pull request. Here's an example: execute the -command ``python3 run.py --task "design a 2048 game" --name "2048" --org "THUNLP" --config "Default"``. This will -create a software package and generate a folder named ``/WareHouse/2048_THUNLP_timestamp``. Inside, you'll find: - -- All the files and documents related to the 2048 game software -- Configuration files of the company responsible for this software, including the three JSON config files - from ``CompanyConfig/Default`` -- A comprehensive log detailing the software's building process that can be used to replay (``timestamp.log``) -- The initial prompt used to create this software (``2048.prompt``) - -**See community contributed software [here](Contribution.md)!** - -## 👨‍💻‍ Contributors - - - - - -Made with [contrib.rocks](https://contrib.rocks). -## 🔎 Citation - -``` -@misc{qian2023communicative, - title={Communicative Agents for Software Development}, - author={Chen Qian and Xin Cong and Wei Liu and Cheng Yang and Weize Chen and Yusheng Su and Yufan Dang and Jiahao Li and Juyuan Xu and Dahai Li and Zhiyuan Liu and Maosong Sun}, - year={2023}, - eprint={2307.07924}, - archivePrefix={arXiv}, - primaryClass={cs.SE} -} -``` - -## ⚖️ License - -- Source Code Licensing: Our project's source code is licensed under the Apache 2.0 License. This license permits the use, modification, and distribution of the code, subject to certain conditions outlined in the Apache 2.0 License. -- Project Open-Source Status: The project is indeed open-source; however, this designation is primarily intended for non-commercial purposes. While we encourage collaboration and contributions from the community for research and non-commercial applications, it is important to note that any utilization of the project's components for commercial purposes necessitates separate licensing agreements. -- Data Licensing: The related data utilized in our project is licensed under CC BY-NC 4.0. This license explicitly permits non-commercial use of the data. We would like to emphasize that any models trained using these datasets should strictly adhere to the non-commercial usage restriction and should be employed exclusively for research purposes. - -## 🌟 Star History - -[![Star History Chart](https://api.star-history.com/svg?repos=openbmb/chatdev&type=Date)](https://star-history.com/#openbmb/chatdev&Date) - - -## 🤝 Acknowledgments -   -   -   - - -## 📬 Contact - -If you have any questions, feedback, or would like to get in touch, please feel free to reach out to us via email at [chatdev.openbmb@outlook.com](mailto:chatdev.openbmb@outlook.com) +THIS IS A TEST TRANSLATION I WILL REVERT THIS \ No newline at end of file From 0c3a04448fed17096a08b54a36d119cbf5226d36 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 22:35:07 +1100 Subject: [PATCH 51/59] revert readme + Combine Download & PR req --- .github/workflows/translate.yml | 12 +- README.md | 197 +++++++++++++++++++++++++++++++- 2 files changed, 198 insertions(+), 11 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 11c970588..c151d01ef 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -42,20 +42,12 @@ jobs: CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - name: Download from Crowdin + - name: Download from Crowdin & Create PR with new translations uses: crowdin/github-action@v1 with: command: 'download' download_translations: true localization_branch_name: l10n_crowdin_translations - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - - name: Create PR with new translations - uses: crowdin/github-action@v1 - with: create_pull_request: true pull_request_title: 'New Crowdin Translations' pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)' @@ -63,4 +55,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index b455af910..cf15db888 100644 --- a/README.md +++ b/README.md @@ -1 +1,196 @@ -THIS IS A TEST TRANSLATION I WILL REVERT THIS \ No newline at end of file +# Communicative Agents for Software Development + +

+ +

+ +

+ 【English | Chinese | Japanese | Korean | Filipino | French | Slovak | Portuguese | Spanish | Dutch | Hindi】 +

+

+ 【📚 Wiki | 🚀 Local Demo | 👥 Community Built Software | 🔧 Customization】 +

+ +## 📖 Overview + +- **ChatDev** stands as a **virtual software company** that operates through various **intelligent agents** holding + different roles, including Chief Executive Officer , Chief Product Officer , Chief Technology Officer , programmer , reviewer , tester , art designer . These + agents form a multi-agent organizational structure and are united by a mission to "revolutionize the digital world + through programming." The agents within ChatDev **collaborate** by participating in specialized functional seminars, + including tasks such as designing, coding, testing, and documenting. +- The primary objective of ChatDev is to offer an **easy-to-use**, **highly customizable** and **extendable** framework, + which is based on large language models (LLMs) and serves as an ideal scenario for studying collective intelligence. +

+ +

+ +## 🎉 News + +* **October 26th, 2023: ChatDev is now supported with Docker for safe execution** (thanks to contribution from [ManindraDeMel](https://github.com/ManindraDeMel)). Please see [Docker Start Guide](wiki.md#docker-start). +

+ +

+* September 25th, 2023: The **Git** mode is now available, enabling the programmer to utilize Git for version control. To enable this feature, simply set ``"git_management"`` to ``"True"`` in ``ChatChainConfig.json``. See [guide](wiki.md#git-mode). +

+ +

+* September 20th, 2023: The **Human-Agent-Interaction** mode is now available! You can get involved with the ChatDev team by playing the role of reviewer and making suggestions to the programmer ; + try ``python3 run.py --task [description_of_your_idea] --config "Human"``. See [guide](wiki.md#human-agent-interaction) and [example](WareHouse/Gomoku_HumanAgentInteraction_20230920135038). +

+ +

+* September 1st, 2023: The **Art** mode is available now! You can activate the designer agent to generate images used in the software; + try ``python3 run.py --task [description_of_your_idea] --config "Art"``. See [guide](wiki.md#art) and [example](WareHouse/gomokugameArtExample_THUNLP_20230831122822). +* August 28th, 2023: The system is publicly available. +* August 17th, 2023: The v1.0.0 version was ready for release. +* July 30th, 2023: Users can customize ChatChain, Phase, and Role settings. Additionally, both online Log mode and replay + mode are now supported. +* July 16th, 2023: The [preprint paper](https://arxiv.org/abs/2307.07924) associated with this project was published. +* June 30th, 2023: The initial version of the ChatDev repository was released. + +## ❓ What Can ChatDev Do? + +![intro](misc/intro.png) + +https://github.com/OpenBMB/ChatDev/assets/11889052/80d01d2f-677b-4399-ad8b-f7af9bb62b72 + +## ⚡️ Quickstart + +### 🖥️ Quickstart with terminal + +To get started, follow these steps: + +1. **Clone the GitHub Repository:** Begin by cloning the repository using the command: + ``` + git clone https://github.com/OpenBMB/ChatDev.git + ``` +2. **Set Up Python Environment:** Ensure you have a version 3.9 or higher Python environment. You can create and + activate this environment using the following commands, replacing `ChatDev_conda_env` with your preferred environment + name: + ``` + conda create -n ChatDev_conda_env python=3.9 -y + conda activate ChatDev_conda_env + ``` +3. **Install Dependencies:** Move into the `ChatDev` directory and install the necessary dependencies by running: + ``` + cd ChatDev + pip3 install -r requirements.txt + ``` +4. **Set OpenAI API Key:** Export your OpenAI API key as an environment variable. Replace `"your_OpenAI_API_key"` with + your actual API key. Remember that this environment variable is session-specific, so you need to set it again if you + open a new terminal session. + On Unix/Linux: + ``` + export OPENAI_API_KEY="your_OpenAI_API_key" + ``` + On Windows: + ``` + $env:OPENAI_API_KEY="your_OpenAI_API_key" + ``` +5. **Build Your Software:** Use the following command to initiate the building of your software, + replacing `[description_of_your_idea]` with your idea's description and `[project_name]` with your desired project + name: + On Unix/Linux: + ``` + python3 run.py --task "[description_of_your_idea]" --name "[project_name]" + ``` + On Windows: + ``` + python run.py --task "[description_of_your_idea]" --name "[project_name]" + ``` +6. **Run Your Software:** Once generated, you can find your software in the `WareHouse` directory under a specific + project folder, such as `project_name_DefaultOrganization_timestamp`. Run your software using the following command + within that directory: + On Unix/Linux: + ``` + cd WareHouse/project_name_DefaultOrganization_timestamp + python3 main.py + ``` + On Windows: + ``` + cd WareHouse/project_name_DefaultOrganization_timestamp + python main.py + ``` + +### 🐳 Quickstart with Docker +- We thank [ManindraDeMel](https://github.com/ManindraDeMel) for providing Docker support. Please see [Docker Start Guide](wiki.md#docker-start). + +## ✨️ Advanced Skills + +For more detailed information, please refer to our [Wiki](wiki.md), where you can find: + +- An introduction to all command run parameters. +- A straightforward guide for setting up a local web demo, which includes enhanced visualized logs, a replay demo, and a + simple ChatChain Visualizer. +- An overview of the ChatDev framework. +- A comprehensive introduction to all advanced parameters in ChatChain configuration. +- Guides for customizing ChatDev, including: + - ChatChain: Design your own software development process (or any other process), such + as ``DemandAnalysis -> Coding -> Testing -> Manual``. + - Phase: Design your own phase within ChatChain, like ``DemandAnalysis``. + - Role: Defining the various agents in your company, such as the ``Chief Executive Officer``. + +## 🤗 Share Your Software! + +**Code**: We are enthusiastic about your interest in participating in our open-source project. If you come across any +problems, don't hesitate to report them. Feel free to create a pull request if you have any inquiries or if you are +prepared to share your work with us! Your contributions are highly valued. Please let me know if there's anything else +you need assistance! + +**Company**: Creating your own customized "ChatDev Company" is a breeze. This personalized setup involves three simple +configuration JSON files. Check out the example provided in the ``CompanyConfig/Default`` directory. For detailed +instructions on customization, refer to our [Wiki](wiki.md). + +**Software**: Whenever you develop software using ChatDev, a corresponding folder is generated containing all the +essential information. Sharing your work with us is as simple as making a pull request. Here's an example: execute the +command ``python3 run.py --task "design a 2048 game" --name "2048" --org "THUNLP" --config "Default"``. This will +create a software package and generate a folder named ``/WareHouse/2048_THUNLP_timestamp``. Inside, you'll find: + +- All the files and documents related to the 2048 game software +- Configuration files of the company responsible for this software, including the three JSON config files + from ``CompanyConfig/Default`` +- A comprehensive log detailing the software's building process that can be used to replay (``timestamp.log``) +- The initial prompt used to create this software (``2048.prompt``) + +**See community contributed software [here](Contribution.md)!** + +## 👨‍💻‍ Contributors + + + + + +Made with [contrib.rocks](https://contrib.rocks). +## 🔎 Citation + +``` +@misc{qian2023communicative, + title={Communicative Agents for Software Development}, + author={Chen Qian and Xin Cong and Wei Liu and Cheng Yang and Weize Chen and Yusheng Su and Yufan Dang and Jiahao Li and Juyuan Xu and Dahai Li and Zhiyuan Liu and Maosong Sun}, + year={2023}, + eprint={2307.07924}, + archivePrefix={arXiv}, + primaryClass={cs.SE} +} +``` + +## ⚖️ License + +- Source Code Licensing: Our project's source code is licensed under the Apache 2.0 License. This license permits the use, modification, and distribution of the code, subject to certain conditions outlined in the Apache 2.0 License. +- Project Open-Source Status: The project is indeed open-source; however, this designation is primarily intended for non-commercial purposes. While we encourage collaboration and contributions from the community for research and non-commercial applications, it is important to note that any utilization of the project's components for commercial purposes necessitates separate licensing agreements. +- Data Licensing: The related data utilized in our project is licensed under CC BY-NC 4.0. This license explicitly permits non-commercial use of the data. We would like to emphasize that any models trained using these datasets should strictly adhere to the non-commercial usage restriction and should be employed exclusively for research purposes. + +## 🌟 Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=openbmb/chatdev&type=Date)](https://star-history.com/#openbmb/chatdev&Date) + + +## 🤝 Acknowledgments +   +   +   + + +## 📬 Contact + +If you have any questions, feedback, or would like to get in touch, please feel free to reach out to us via email at [chatdev.openbmb@outlook.com](mailto:chatdev.openbmb@outlook.com) From 869dfc9624d746ba4635e44fee0fa7aa9bf96194 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 22:39:24 +1100 Subject: [PATCH 52/59] attempt to fix PR capabilities --- .github/workflows/translate.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index c151d01ef..c6336d820 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -45,9 +45,10 @@ jobs: - name: Download from Crowdin & Create PR with new translations uses: crowdin/github-action@v1 with: - command: 'download' download_translations: true + # To the specified branch localization_branch_name: l10n_crowdin_translations + # Create pull request after pushing to branch create_pull_request: true pull_request_title: 'New Crowdin Translations' pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)' From 4208877473d18424ba28d5ef79c916a4bd2ac692 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Thu, 26 Oct 2023 23:12:39 +1100 Subject: [PATCH 53/59] update paths for readme --- .github/workflows/translate.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index c6336d820..5aedafdfd 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -42,13 +42,26 @@ jobs: CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - name: Download from Crowdin & Create PR with new translations + - name: Download from Crowdin uses: crowdin/github-action@v1 with: download_translations: true - # To the specified branch localization_branch_name: l10n_crowdin_translations - # Create pull request after pushing to branch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Update paths for translated READMEs + run: | + find readme -name "README-*.md" -exec sed -i 's|src="\./|src="../|g' {} \; + find readme -name "README-*.md" -exec sed -i 's|href="\./|href="../|g' {} \; + find readme -name "README-*.md" -exec sed -i 's|src="\([^http]\)|src="../\1|g' {} \; + find readme -name "README-*.md" -exec sed -i 's|href="\([^http]\)|href="../\1|g' {} \; + + - name: Create PR with new translations + uses: crowdin/github-action@v1 + with: create_pull_request: true pull_request_title: 'New Crowdin Translations' pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)' From 9d51b3fc4526957843cc4a0fc8c167afa11ae377 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 27 Oct 2023 00:38:24 +1100 Subject: [PATCH 54/59] added commit for link refactor --- .github/workflows/translate.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 5aedafdfd..53ed43d0d 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -58,6 +58,8 @@ jobs: find readme -name "README-*.md" -exec sed -i 's|href="\./|href="../|g' {} \; find readme -name "README-*.md" -exec sed -i 's|src="\([^http]\)|src="../\1|g' {} \; find readme -name "README-*.md" -exec sed -i 's|href="\([^http]\)|href="../\1|g' {} \; + git add readme/ + git commit -m "Updated paths in translated READMEs" - name: Create PR with new translations uses: crowdin/github-action@v1 From ed53f7ef76774555c4a911aab0f399059713cd20 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 27 Oct 2023 00:43:34 +1100 Subject: [PATCH 55/59] added git user to link refactor --- .github/workflows/translate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 53ed43d0d..696ee1ba7 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -58,9 +58,12 @@ jobs: find readme -name "README-*.md" -exec sed -i 's|href="\./|href="../|g' {} \; find readme -name "README-*.md" -exec sed -i 's|src="\([^http]\)|src="../\1|g' {} \; find readme -name "README-*.md" -exec sed -i 's|href="\([^http]\)|href="../\1|g' {} \; + git config user.email "github-action@github.com" + git config user.name "GitHub Action" git add readme/ git commit -m "Updated paths in translated READMEs" + - name: Create PR with new translations uses: crowdin/github-action@v1 with: From 27337428b457106cb06e88d9f62f9bae4b5f5a21 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 27 Oct 2023 00:52:09 +1100 Subject: [PATCH 56/59] split up git work --- .github/workflows/translate.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 696ee1ba7..1fbe93c98 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -12,7 +12,7 @@ on: workflow_dispatch: jobs: - synchronize-with-crowdin: + Translate: runs-on: ubuntu-latest permissions: contents: write @@ -52,16 +52,28 @@ jobs: CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + - name: Set Git Identity + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + - name: Switch to new branch + run: | + git checkout l10n_crowdin_translations + - name: Update paths for translated READMEs run: | find readme -name "README-*.md" -exec sed -i 's|src="\./|src="../|g' {} \; find readme -name "README-*.md" -exec sed -i 's|href="\./|href="../|g' {} \; find readme -name "README-*.md" -exec sed -i 's|src="\([^http]\)|src="../\1|g' {} \; find readme -name "README-*.md" -exec sed -i 's|href="\([^http]\)|href="../\1|g' {} \; - git config user.email "github-action@github.com" - git config user.name "GitHub Action" - git add readme/ - git commit -m "Updated paths in translated READMEs" + + - name: Commit changes + run: | + git add -A + git commit -m "Update paths in translated READMEs" + git push origin l10n_crowdin_translations + - name: Create PR with new translations From 03075d62d718d18f8cdf4191ab324c4aa979431b Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 27 Oct 2023 00:59:25 +1100 Subject: [PATCH 57/59] add permissions --- .github/workflows/translate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 1fbe93c98..66e61219b 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -56,6 +56,9 @@ jobs: run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" + + - name: Adjust .git permissions + run: sudo chmod -R 777 .git - name: Switch to new branch run: | From cf9e4a27698eaafb18414aefa70c8788aed4ad63 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 27 Oct 2023 01:11:45 +1100 Subject: [PATCH 58/59] changed from https to match different quotes --- .github/workflows/translate.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 66e61219b..d8afb870b 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -56,7 +56,7 @@ jobs: run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - + - name: Adjust .git permissions run: sudo chmod -R 777 .git @@ -66,10 +66,11 @@ jobs: - name: Update paths for translated READMEs run: | - find readme -name "README-*.md" -exec sed -i 's|src="\./|src="../|g' {} \; find readme -name "README-*.md" -exec sed -i 's|href="\./|href="../|g' {} \; - find readme -name "README-*.md" -exec sed -i 's|src="\([^http]\)|src="../\1|g' {} \; - find readme -name "README-*.md" -exec sed -i 's|href="\([^http]\)|href="../\1|g' {} \; + find readme -name "README-*.md" -exec sed -i 's|src="\./|src="../|g' {} \; + find readme -name "README-*.md" -exec sed -i "s|href='\./|href='../|g" {} \; + find readme -name "README-*.md" -exec sed -i "s|src='\./|src='../|g" {} \; + - name: Commit changes run: | From a06b123e43f42d924ddb9524bec5bc44a128ecb7 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 27 Oct 2023 01:25:34 +1100 Subject: [PATCH 59/59] added docs --- .github/workflows/translate.yml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index d8afb870b..7fa2eef32 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -1,6 +1,6 @@ name: Translate Readme -on: +on: # This workflow triggers on pushes and PRs to the main branch, specifically affecting the README.md push: branches: [ main ] paths: @@ -9,7 +9,7 @@ on: branches: [ main ] paths: - 'README.md' - workflow_dispatch: + workflow_dispatch: # Also provides a manual trigger option jobs: Translate: @@ -19,10 +19,10 @@ jobs: pull-requests: write steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout # Fetches the current repo's content + uses: actions/checkout@v3 - - name: Upload to Crowdin + - name: Upload to Crowdin # Uploads any changes in specified files to Crowdin uses: crowdin/github-action@v1 with: command: 'upload' @@ -32,7 +32,7 @@ jobs: CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - name: Apply Machine Translation + - name: Apply Machine Translation # Applies machine translation to the new content in various languages uses: crowdin/github-action@v1 with: command: 'pre-translate' @@ -42,7 +42,7 @@ jobs: CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - name: Download from Crowdin + - name: Download from Crowdin # Downloads the translated files from Crowdin uses: crowdin/github-action@v1 with: download_translations: true @@ -52,35 +52,32 @@ jobs: CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - name: Set Git Identity + - name: Set Git Identity # This sets the identity for the git user to clearly indicate that changes are made by the GitHub Action. run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - - name: Adjust .git permissions + - name: Adjust .git permissions # Adjusting permissions ensures that the GitHub Action has the required permissions to perform subsequent operations. run: sudo chmod -R 777 .git - - name: Switch to new branch + - name: Switch to new branch # It switches to a dedicated branch for Crowdin translations. This keeps translations separate until they're ready to be merged. run: | git checkout l10n_crowdin_translations - - name: Update paths for translated READMEs + - name: Update paths for translated READMEs # This step updates the paths in the translated READMEs, ensuring links and image sources point to the correct locations. run: | find readme -name "README-*.md" -exec sed -i 's|href="\./|href="../|g' {} \; find readme -name "README-*.md" -exec sed -i 's|src="\./|src="../|g' {} \; find readme -name "README-*.md" -exec sed -i "s|href='\./|href='../|g" {} \; find readme -name "README-*.md" -exec sed -i "s|src='\./|src='../|g" {} \; - - - - name: Commit changes + + - name: Commit changes # After updating paths, it commits and pushes the changes to the branch designated for translations. run: | git add -A git commit -m "Update paths in translated READMEs" git push origin l10n_crowdin_translations - - - - name: Create PR with new translations + - name: Create PR with new translations # The final step in the process is to create a Pull Request with the new translations. Once reviewed and approved, the translations can be merged into the main branch. uses: crowdin/github-action@v1 with: create_pull_request: true