├── .DS_Store
├── .gitattributes
├── .github
└── workflows
│ ├── deploy_doc_site.yml
│ ├── deploy_release.yml
│ ├── pylint.yml
│ ├── python-package.yml
│ ├── release_linux.yml
│ ├── release_mac_intel.yml
│ └── release_win.yml
├── .gitignore
├── README.md
├── dist
├── linux
│ └── nuwa.spec
├── mac_intel
│ ├── nuwa.spec
│ └── start.sh
├── s3_website
│ ├── README.md
│ └── index.html
└── win
│ └── nuwa.spec
├── example_project
└── config
│ ├── action
│ ├── attack.json
│ ├── catch.json
│ ├── continue.json
│ ├── follow.json
│ ├── get.json
│ ├── give.json
│ ├── mov.json
│ ├── move.json
│ ├── pick.json
│ ├── put.json
│ ├── release.json
│ ├── stand.json
│ ├── talk.json
│ └── use.json
│ ├── knowledge
│ └── scenes
│ │ ├── Desert.json
│ │ ├── Elon家.json
│ │ ├── 旅馆.json
│ │ ├── 旅馆二层客房区.json
│ │ ├── 荒野小镇.json
│ │ ├── 警局.json
│ │ ├── 警长家.json
│ │ ├── 酒吧.json
│ │ └── 银行.json
│ ├── llm_config.json
│ └── npc
│ ├── README.md
│ ├── old
│ ├── 保安Jake.json
│ ├── 冒险家Lucy.json
│ ├── 印第安人Aiyana.json
│ ├── 囚犯阿呆.json
│ ├── 土匪Red.json
│ ├── 土匪Slim.json
│ ├── 幽灵猎手Specter.json
│ ├── 时空旅者Elon.json
│ ├── 李大爷.json
│ ├── 村长.json
│ ├── 歌女Clara.json
│ ├── 渔夫阿强.json
│ ├── 牛仔John.json
│ ├── 猎人阿明.json
│ ├── 王大妈.json
│ ├── 警员1.json
│ ├── 警员2.json
│ ├── 警长.json
│ ├── 警长Marshal Thompson.json
│ ├── 警长Woody.json
│ ├── 酒吧老板Morton.json
│ └── 银行经理Mr. Wilson.json
│ ├── 大司马.json
│ ├── 草泥马.json
│ └── 西格马.json
├── nuwa
├── __init__.py
├── doc
│ ├── README.md
│ ├── docs
│ │ ├── etc
│ │ │ └── feedback.md
│ │ ├── img
│ │ │ ├── action_module.png
│ │ │ ├── conversation_module.png
│ │ │ ├── demo.gif
│ │ │ ├── overview.png
│ │ │ ├── phase1.jpg
│ │ │ ├── phase2.png
│ │ │ ├── player2npc.png
│ │ │ ├── solution.png
│ │ │ └── solution2.png
│ │ ├── index.md
│ │ ├── modules
│ │ │ ├── action.md
│ │ │ ├── conversation.md
│ │ │ └── talk.md
│ │ └── tutorials
│ │ │ ├── action.md
│ │ │ ├── conversation.md
│ │ │ ├── debug.md
│ │ │ ├── engine.md
│ │ │ ├── npc.md
│ │ │ ├── quickstart.md
│ │ │ └── scenario.md
│ └── mkdocs.yml
├── material
│ ├── badges
│ │ ├── pylint.svg
│ │ └── pytest.svg
│ └── templates
│ │ └── template.zip
├── poetry.lock
├── pylint.conf
├── pyproject.toml
├── requirements.txt
├── run_code_check.py
├── sender.ipynb
├── src
│ ├── Nuwa.py
│ ├── __init__.py
│ ├── config
│ │ ├── __init__.py
│ │ ├── config.py
│ │ ├── generate_path.py
│ │ └── template.py
│ ├── engine.py
│ ├── npc
│ │ ├── __init__.py
│ │ ├── action.py
│ │ ├── conversation.py
│ │ ├── knowledge.py
│ │ ├── memory.py
│ │ ├── npc.py
│ │ ├── talk_box.py
│ │ └── test.py
│ └── utils
│ │ ├── __init__.py
│ │ ├── cli.py
│ │ ├── database.py
│ │ ├── embedding.py
│ │ ├── engine_logger.py
│ │ ├── fail_safe.py
│ │ ├── faissdatabase.py
│ │ ├── model_api.py
│ │ └── send_utils.py
└── test
│ ├── README.md
│ ├── __init__.py
│ ├── game_sim.py
│ ├── test_config
│ └── test_packets.py
│ ├── test_conversation.py
│ ├── test_database.py
│ ├── test_embedding.py
│ ├── test_npc_action.ipynb
│ └── test_npc_action.py
└── setup.py
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/casia22/npc_engine/992fbdbafe50b10c8f0a14de8c61bb5db46eda78/.DS_Store
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | material/models/embedding/* filter=lfs diff=lfs merge=lfs -text
2 | *.bin filter=lfs diff=lfs merge=lfs -text
3 |
--------------------------------------------------------------------------------
/.github/workflows/deploy_doc_site.yml:
--------------------------------------------------------------------------------
1 | name: Deploy MkDocs
2 |
3 | on:
4 | push:
5 | branches:
6 | - main # 或者你的默认分支
7 |
8 | jobs:
9 | deploy:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Check out code
13 | uses: actions/checkout@v2
14 |
15 | - name: Set up Python
16 | uses: actions/setup-python@v2
17 | with:
18 | python-version: 3.9
19 |
20 | - name: Install dependencies
21 | run: |
22 | python -m pip install --upgrade pip
23 | pip install mkdocs
24 |
25 | - name: Build site
26 | run: |
27 | cd nuwa/doc/
28 | mkdocs build --verbose --clean
29 |
30 | - name: Deploy to GitHub Pages
31 | uses: peaceiris/actions-gh-pages@v3
32 | with:
33 | personal_token: ${{ secrets.PERSONAL_TOKEN }}
34 | publish_dir: ./nuwa/doc/site
35 | user_name: 'github-actions[bot]'
36 | user_email: 'github-actions[bot]@users.noreply.github.com'
37 | publish_branch: gh-pages
38 | external_repository: casia22/npc_engine_doc
39 |
--------------------------------------------------------------------------------
/.github/workflows/deploy_release.yml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/casia22/npc_engine/992fbdbafe50b10c8f0a14de8c61bb5db46eda78/.github/workflows/deploy_release.yml
--------------------------------------------------------------------------------
/.github/workflows/pylint.yml:
--------------------------------------------------------------------------------
1 | name: Pylint
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build:
7 | runs-on: ubuntu-latest
8 | strategy:
9 | matrix:
10 | python-version: ["3.9"]
11 | steps:
12 | - uses: actions/checkout@v3
13 | - name: Set up Python ${{ matrix.python-version }}
14 | uses: actions/setup-python@v3
15 | with:
16 | python-version: ${{ matrix.python-version }}
17 | - name: Install dependencies
18 | run: |
19 | python -m pip install --upgrade pip
20 | pip install pylint
21 | - name: Analysing the code with pylint
22 | run: |
23 | pylint $(git ls-files '*.py')
24 |
--------------------------------------------------------------------------------
/.github/workflows/python-package.yml:
--------------------------------------------------------------------------------
1 | # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3 |
4 | name: Python package
5 |
6 | on:
7 | push:
8 | branches: [ "style_check","main"]
9 | pull_request:
10 | branches: [ "main" ]
11 |
12 | jobs:
13 | build:
14 |
15 | runs-on: ubuntu-latest
16 | strategy:
17 | fail-fast: false
18 | matrix:
19 | python-version: ["3.9"]
20 |
21 | steps:
22 | - uses: actions/checkout@v3
23 | - name: Set up Python ${{ matrix.python-version }}
24 | uses: actions/setup-python@v3
25 | with:
26 | python-version: ${{ matrix.python-version }}
27 | - name: Install dependencies
28 | run: |
29 | python -m pip install --upgrade pip
30 | python -m pip install flake8 pytest anybadge
31 | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32 | - name: Test with pytest
33 | run: |
34 | python run_code_check.py
35 | - name: Commit and push
36 | run: |
37 | git config --local user.email "action@github.com"
38 | git config --local user.name "GitHub Action"
39 | git add ./material/badges/pylint.svg ./material/badges/pytest.svg README.md
40 | git commit -m "Update badge" -a
41 | git push
42 |
--------------------------------------------------------------------------------
/.github/workflows/release_linux.yml:
--------------------------------------------------------------------------------
1 | name: Release for linux # 目前只是Ubuntu的用户端SDK; linux上面还需要做服务器端SDK打包到docker里面提供web服务这样
2 |
3 | on:
4 | push:
5 | branches:
6 | - release # 或者你希望触发此工作流程的任何分支
7 | - release_linux
8 |
9 | jobs:
10 | build-and-deploy:
11 | strategy:
12 | matrix:
13 | os: [ubuntu-20.04, ubuntu-18.04, debian-10, debian-9, centos-8, centos-7] # , fedora-34] # 或者你需要的任何其他环境
14 | runs-on: ${{ matrix.os }}
15 |
16 | steps:
17 | - name: Checkout repository
18 | uses: actions/checkout@v2
19 |
20 | - name: Set up Python
21 | uses: actions/setup-python@v2
22 | with:
23 | python-version: '3.9.6' # 选择适合你项目的 Python 版本
24 |
25 | - name: Install dependencies
26 | run: |
27 | pip install -r nuwa/requirements.txt
28 | pip install https://github.com/pyinstaller/pyinstaller/tarball/develop
29 | pip install -e .
30 |
31 | - name: Download models and init project
32 | run: |
33 | nuwa download
34 | cd dist/linux
35 | nuwa init -n project
36 |
37 | - name: Package with PyInstaller
38 | run: |
39 | cd dist/linux # 如果需要在这个目录下运行 pyinstaller
40 | nuwa_version=$(nuwa -v)
41 | app_name="nuwa_${nuwa_version}"
42 | zip_name="nuwa_linux_${{ matrix.os }}_${nuwa_version}.zip"
43 | pyinstaller nuwa.spec
44 | mv project dist/
45 | zip -r $zip_name dist/*
46 |
47 | - name: Configure AWS credentials
48 | uses: aws-actions/configure-aws-credentials@v1
49 | with:
50 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
51 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
52 | aws-region: 'us-west-2' # 例如: us-east-1
53 |
54 | - name: Upload to S3
55 | run: |
56 | nuwa_version=$(nuwa -v)
57 | zip_name="nuwa_linux_${{ matrix.os }}_${nuwa_version}.zip"
58 | cd dist/linux
59 | aws s3 cp $zip_name s3://nuwa-release/release/linux/$zip_name
60 |
--------------------------------------------------------------------------------
/.github/workflows/release_mac_intel.yml:
--------------------------------------------------------------------------------
1 | name: Release for mac intel
2 |
3 | on:
4 | push:
5 | branches:
6 | - release # 或者你希望触发此工作流程的任何分支
7 | - release_mac
8 |
9 | jobs:
10 | build-and-deploy:
11 | strategy:
12 | matrix:
13 | os: [macos-12, macos-11] # 或者你需要的任何其他环境
14 | runs-on: ${{ matrix.os }}
15 |
16 | steps:
17 | - name: Checkout repository
18 | uses: actions/checkout@v2
19 |
20 | - name: Set up Python
21 | uses: actions/setup-python@v2
22 | with:
23 | python-version: '3.9.6' # 选择适合你项目的 Python 版本
24 |
25 | - name: Install dependencies
26 | run: |
27 | pip install -r nuwa/requirements.txt
28 | pip install https://github.com/pyinstaller/pyinstaller/tarball/develop
29 | pip install -e .
30 |
31 | - name: Download models and init project
32 | run: |
33 | nuwa download
34 | cd dist/mac_intel
35 | nuwa init -n project
36 |
37 | - name: Package with PyInstaller
38 | run: |
39 | cd dist/mac_intel # 如果需要在这个目录下运行 pyinstaller
40 | nuwa_version=$(nuwa -v)
41 | app_name="nuwa_${nuwa_version}"
42 | zip_name="nuwa_mac_intel_${{ matrix.os }}_${nuwa_version}.zip"
43 | pyinstaller nuwa.spec
44 | mv dist/nuwa* dist/$app_name
45 | mv project dist/
46 | zip -r $zip_name dist/*
47 |
48 | - name: Configure AWS credentials
49 | uses: aws-actions/configure-aws-credentials@v1
50 | with:
51 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
52 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
53 | aws-region: 'us-west-2' # 例如: us-east-1
54 |
55 | - name: Upload to S3
56 | run: |
57 | nuwa_version=$(nuwa -v)
58 | zip_name="nuwa_mac_intel_${{ matrix.os }}_${nuwa_version}.zip"
59 | cd dist/mac_intel
60 | aws s3 cp $zip_name s3://nuwa-release/release/mac_intel/$zip_name
61 |
--------------------------------------------------------------------------------
/.github/workflows/release_win.yml:
--------------------------------------------------------------------------------
1 | name: Release for Windows
2 |
3 | on:
4 | push:
5 | branches:
6 | - release # 或者你希望触发此工作流程的任何分支
7 | - release_win
8 |
9 | jobs:
10 | build-and-deploy:
11 | runs-on: windows-latest # 使用最新的 Windows 环境
12 |
13 | steps:
14 | - name: Checkout repository
15 | uses: actions/checkout@v2
16 |
17 | - name: Set up Python
18 | uses: actions/setup-python@v2
19 | with:
20 | python-version: '3.9.6' # 选择适合你项目的 Python 版本
21 |
22 | - name: Set environment variable
23 | run: echo "PYTHONIOENCODING=UTF-8" >> $GITHUB_ENV
24 |
25 | - name: Install dependencies
26 | run: |
27 | pip install -r nuwa/requirements.txt
28 | pip install https://github.com/pyinstaller/pyinstaller/tarball/develop
29 | pip install -e .
30 |
31 | - name: Download models and init project
32 | run: |
33 | nuwa download
34 | cd dist/win
35 | nuwa init -n project
36 |
37 | - name: Package with PyInstaller
38 | run: |
39 | cd dist\win
40 | $nuwa_version = nuwa -v
41 | $app_name = "nuwa_$($nuwa_version).exe"
42 | $zip_name = "nuwa_windows_$($nuwa_version).zip"
43 | pyinstaller nuwa.spec
44 | Move-Item project dist\
45 | Compress-Archive -Path dist\* -DestinationPath $zip_name
46 |
47 | - name: Configure AWS credentials
48 | uses: aws-actions/configure-aws-credentials@v1
49 | with:
50 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
51 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
52 | aws-region: 'us-west-2' # 例如: us-east-1
53 |
54 | - name: Upload to S3
55 | run: |
56 | $nuwa_version = nuwa -v
57 | $zip_name = "nuwa_windows_$($nuwa_version).zip"
58 | cd dist\win
59 | aws s3 cp $zip_name s3://nuwa-release/release/windows/$zip_name
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Python
2 | __pycache__/
3 | *.py[cod]
4 | *.so
5 | *.meta
6 | *.egg
7 | *.egg-info/
8 | build/
9 | npc_memory/*
10 |
11 | # ignore
12 | example_project/data/*
13 |
14 | # material 存储模型文件
15 | nuwa/material/models/embedding/*
16 |
17 | # distribution and packaging
18 | dist/mac_intel/project/
19 | dist/*
20 | dist/mac_intel/dist/
21 | !dist/mac_intel/
22 | !dist/mac_intel/nuwa.spec
23 | !dist/win/
24 | !dist/win/nuwa.spec
25 | !dist/linux/
26 | !dist/linux/nuwa.spec
27 | !dist/s3_website
28 |
29 | # documentation
30 | nuwa/doc/site
31 | yzj*
32 | *.log
33 | *.zip
34 | !nuwa/material/templates/template.zip
35 |
36 | # example_project
37 | example_project/data/*.log
38 | example_project/data/*.pkl
39 | example_project/data/*.db
40 | example_project/data/npc_memory.db
41 | # pypi
42 | *.egg-info
43 | *.egg-info/
44 | *.dist-info/
45 | *.dist-info
46 | *.cache
47 | *.log
48 | *.swp
49 | *.swo
50 |
51 | .pytest_cache/
52 | .pyarmor
53 | .idea
54 | test/.pytest_cache/
55 |
56 | .DS_Store
57 | # Poetry
58 | __pypackages__/
59 |
--------------------------------------------------------------------------------
/dist/linux/nuwa.spec:
--------------------------------------------------------------------------------
1 | # -*- mode: python ; coding: utf-8 -*-
2 | from PyInstaller.utils.hooks import collect_data_files
3 | from PyInstaller.utils.hooks import copy_metadata
4 |
5 | # get version from nuwa/__init__.py
6 | import os
7 | os.sys.path.append('../../')
8 | from nuwa import __version__
9 |
10 | # get data files
11 | datas = [("../../nuwa/material","nuwa/material")]
12 | datas += collect_data_files('torch')
13 | datas += copy_metadata('torch')
14 | datas += copy_metadata('tqdm')
15 | datas += copy_metadata('regex')
16 | datas += copy_metadata('requests')
17 | datas += copy_metadata('filelock')
18 | datas += copy_metadata('packaging')
19 | datas += copy_metadata('numpy')
20 | datas += copy_metadata('tokenizers')
21 | datas += copy_metadata('importlib_metadata')
22 | datas += copy_metadata('huggingface-hub')
23 | datas += copy_metadata('sentence_transformers', recursive=True)
24 |
25 |
26 | block_cipher = None
27 |
28 |
29 | a = Analysis(
30 | ['../../nuwa/src/Nuwa.py'],
31 | pathex=[],
32 | binaries=[],
33 | datas=datas,
34 | hiddenimports=['pytorch', 'sklearn.utils._cython_blas', 'sklearn.neighbors.typedefs', 'sklearn.neighbors.quad_tree', 'sklearn.tree', 'sklearn.tree._utils'],
35 | hookspath=[],
36 | hooksconfig={},
37 | runtime_hooks=[],
38 | excludes=[],
39 | win_no_prefer_redirects=False,
40 | win_private_assemblies=False,
41 | cipher=block_cipher,
42 | noarchive=False,
43 | )
44 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
45 |
46 | exe = EXE(
47 | pyz,
48 | a.scripts,
49 | a.binaries,
50 | a.zipfiles,
51 | a.datas,
52 | [],
53 | name=f'nuwa_{__version__}',
54 | debug=False,
55 | bootloader_ignore_signals=False,
56 | strip=False,
57 | upx=True,
58 | upx_exclude=[],
59 | runtime_tmpdir=None,
60 | console=True,
61 | disable_windowed_traceback=False,
62 | argv_emulation=False,
63 | target_arch=None,
64 | codesign_identity=None,
65 | entitlements_file=None,
66 | )
67 |
--------------------------------------------------------------------------------
/dist/mac_intel/nuwa.spec:
--------------------------------------------------------------------------------
1 | # -*- mode: python ; coding: utf-8 -*-
2 | from PyInstaller.utils.hooks import collect_data_files
3 | from PyInstaller.utils.hooks import copy_metadata
4 |
5 | datas = []
6 | datas += collect_data_files('torch')
7 | datas += copy_metadata('torch')
8 | datas += copy_metadata('tqdm')
9 | datas += copy_metadata('regex')
10 | datas += copy_metadata('requests')
11 | datas += copy_metadata('filelock')
12 | datas += copy_metadata('packaging')
13 | datas += copy_metadata('numpy')
14 | datas += copy_metadata('tokenizers')
15 | datas += copy_metadata('importlib_metadata')
16 | datas += copy_metadata('huggingface-hub')
17 | datas += copy_metadata('sentence_transformers', recursive=True)
18 |
19 |
20 | a = Analysis(
21 | ['../../nuwa/src/nuwa.py'],
22 | pathex=[],
23 | binaries=[],
24 | datas=datas,
25 | hiddenimports=['pytorch', 'sklearn.utils._cython_blas', 'sklearn.neighbors.typedefs', 'sklearn.neighbors.quad_tree', 'sklearn.tree', 'sklearn.tree._utils'],
26 | hookspath=[],
27 | hooksconfig={},
28 | runtime_hooks=[],
29 | excludes=[],
30 | noarchive=False,
31 | )
32 | pyz = PYZ(a.pure)
33 |
34 | exe = EXE(
35 | pyz,
36 | a.scripts,
37 | [],
38 | exclude_binaries=True,
39 | name='nuwa',
40 | debug=False,
41 | bootloader_ignore_signals=False,
42 | strip=False,
43 | upx=True,
44 | console=True,
45 | disable_windowed_traceback=False,
46 | argv_emulation=False,
47 | target_arch=None,
48 | codesign_identity=None,
49 | entitlements_file=None,
50 | )
51 | coll = COLLECT(
52 | exe,
53 | a.binaries,
54 | a.datas,
55 | strip=False,
56 | upx=True,
57 | upx_exclude=[],
58 | name='nuwa',
59 | )
60 |
--------------------------------------------------------------------------------
/dist/mac_intel/start.sh:
--------------------------------------------------------------------------------
1 | # https://stackoverflow.com/questions/71863714/packagenotfound-error-while-executing-exe-file-made-by-pyinstaller
2 |
3 | pyinstaller --onefile --recursive-copy-metadata sentence_transformers --hidden-import=pytorch --collect-data torch --copy-metadata torch --copy-metadata tqdm --copy-metadata regex --copy-metadata requests --copy-metadata filelock --copy-metadata packaging --copy-metadata numpy --copy-metadata tokenizers --copy-metadata importlib_metadata --copy-metadata huggingface-hub --hidden-import="sklearn.utils._cython_blas" --hidden-import="sklearn.neighbors.typedefs" --hidden-import="sklearn.neighbors.quad_tree" --hidden-import="sklearn.tree" --hidden-import="sklearn.tree._utils" ../../nuwa/src/nuwa.py &&dist/nuwa
4 |
--------------------------------------------------------------------------------
/dist/s3_website/README.md:
--------------------------------------------------------------------------------
1 | # 使用事项
2 | 我们项目打包发布后会上传到S3上,但是需要有一网页让大家都能看到并下载里面的内容.
3 |
4 | 这个index.html就是做这个事情的
5 | 参照的项目是[这里](https://github.com/rufuspollock/s3-bucket-listing/issues/46)
6 |
7 | ## S3 bucket
8 | 我们的S3 bucket是nuwa-release 在us-west-2
9 |
10 | 项目我手动使用gpt配置了访问策略和CORS策略以及静态网站托管
11 |
12 |
13 | 上传cmd:
14 | ```
15 | aws s3 cp ./index.html s3://nuwa-release/index.html
16 | ```
17 | 但是一般不用动 这里只是留一个存档
18 |
19 |
--------------------------------------------------------------------------------
/dist/s3_website/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
16 |
17 |
18 |
19 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/dist/win/nuwa.spec:
--------------------------------------------------------------------------------
1 | # -*- mode: python ; coding: utf-8 -*-
2 | from PyInstaller.utils.hooks import collect_data_files
3 | from PyInstaller.utils.hooks import copy_metadata
4 |
5 | # get version from nuwa/__init__.py
6 | import os
7 | os.sys.path.append('../../')
8 | from nuwa import __version__
9 |
10 | # get data files
11 | datas = [("../../nuwa/material","nuwa/material")]
12 | datas += collect_data_files('torch')
13 | datas += copy_metadata('torch')
14 | datas += copy_metadata('tqdm')
15 | datas += copy_metadata('regex')
16 | datas += copy_metadata('requests')
17 | datas += copy_metadata('filelock')
18 | datas += copy_metadata('packaging')
19 | datas += copy_metadata('numpy')
20 | datas += copy_metadata('tokenizers')
21 | datas += copy_metadata('importlib_metadata')
22 | datas += copy_metadata('huggingface-hub')
23 | datas += copy_metadata('sentence_transformers', recursive=True)
24 |
25 |
26 | block_cipher = None
27 |
28 |
29 | a = Analysis(
30 | ['../../nuwa/src/Nuwa.py'],
31 | pathex=[],
32 | binaries=[],
33 | datas=datas,
34 | hiddenimports=['pytorch', 'sklearn.utils._cython_blas', 'sklearn.neighbors.typedefs', 'sklearn.neighbors.quad_tree', 'sklearn.tree', 'sklearn.tree._utils'],
35 | hookspath=[],
36 | hooksconfig={},
37 | runtime_hooks=[],
38 | excludes=[],
39 | win_no_prefer_redirects=False,
40 | win_private_assemblies=False,
41 | cipher=block_cipher,
42 | noarchive=False,
43 | )
44 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
45 |
46 | exe = EXE(
47 | pyz,
48 | a.scripts,
49 | a.binaries,
50 | a.zipfiles,
51 | a.datas,
52 | [],
53 | name=f'nuwa_{__version__}',
54 | debug=False,
55 | bootloader_ignore_signals=False,
56 | strip=False,
57 | upx=True,
58 | upx_exclude=[],
59 | runtime_tmpdir=None,
60 | console=True,
61 | disable_windowed_traceback=False,
62 | argv_emulation=False,
63 | target_arch=None,
64 | codesign_identity=None,
65 | entitlements_file=None,
66 | )
67 |
--------------------------------------------------------------------------------
/example_project/config/action/attack.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "attack",
3 | "definition": ",对[person_name]发起攻击,[person_name]必须出现在'观测到的人物'中,并且[person_name]应该是敌对的",
4 | "multi_param": false,
5 | "example": "攻击",
6 | "log_template":{
7 | "success": "{npc_name}对{object}进行了攻击,并成功杀死了{object}",
8 | "fail": "{npc_name}试图攻击{object}并试图杀死{object},但是失败了. 原因是{reason}"
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/example_project/config/action/catch.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "catch",
3 | "definition": ",抓捕[person_name]并将其锁在警察局牢房中,只可以抓捕当前看到的人",
4 | "multi_param": false,
5 | "example": "抓捕",
6 | "log_template":{
7 | "success": "{npc_name}成功抓捕了{object}并将其锁在了警察局牢房",
8 | "fail": "{npc_name}试图抓捕{object},但是失败了. 原因是{reason}"
9 | }
10 | }
--------------------------------------------------------------------------------
/example_project/config/action/continue.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "continue",
3 | "definition": ",继续保持之前的动作",
4 | "multi_param": false,
5 | "example": "continue",
6 | "log_template":{
7 | "success": "{npc_name}保持之前的动作",
8 | "fail": "{npc_name}试图保持之前的动作,但是失败了. 原因是{reason}"
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/example_project/config/action/follow.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "follow",
3 | "definition": ",向[person_name]移动并持续跟随,[person_name]必须出现在'观测到的人物'中",
4 | "multi_param": false,
5 | "example": "follow",
6 | "log_template":{
7 | "success": "{npc_name}跟随{object}走了一段路并成功",
8 | "fail": "{npc_name}试图跟随{object},但是失败了. 原因是{reason}"
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/example_project/config/action/get.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "get",
3 | "definition": ",从[object2]中获得[object1],[object2]可以是人物或者存储器皿;你只可以get'看到的/身上的'物品;",
4 | "multi_param": true,
5 | "example": "或等",
6 | "log_template":{
7 | "success": "{npc_name}成功地从{object}获得了{parameters}",
8 | "fail": "{npc_name}试图从{object}里获得{parameters},但是失败了. 原因是{reason}"
9 | }
10 | }
--------------------------------------------------------------------------------
/example_project/config/action/give.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "give",
3 | "definition": ",将自己身上的某个物品交给角色,物品必须是自己拥有的",
4 | "multi_param": false,
5 | "example": "",
6 | "log_template":{
7 | "success": "{npc_name}将{parameters}交给 {object}",
8 | "fail": "{npc_name}试图将{parameters}交给 {object},但是失败了,原因是{reason}"
9 | }
10 | }
--------------------------------------------------------------------------------
/example_project/config/action/mov.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "move",
3 | "definition": ",向[location]移动,[location]必须为之前提到的确切的地点名称",
4 | "multi_param": false,
5 | "example": "move",
6 | "log_template":{
7 | "success": "{npc_name}成功到达了{object}",
8 | "fail": "{npc_name}试图前往{object},但是失败了. 原因是{reason}"
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/example_project/config/action/move.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "move",
3 | "definition": ",向[location]移动,[location]必须为之前提到的确切的地点或物品名称",
4 | "multi_param": false,
5 | "example": "move",
6 | "log_template":{
7 | "success": "{npc_name}成功到达了{object}",
8 | "fail": "{npc_name}试图前往{object},但是失败了. 原因是{reason}"
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/example_project/config/action/pick.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pick",
3 | "definition": ",将观察到的物品放入自己的物品栏中,物品需要带有item标签才可以,例如 item:obj_name ",
4 | "multi_param": false,
5 | "example": "捡起",
6 | "log_template":{
7 | "success": "{npc_name}将捡起{object}并放入了背包中",
8 | "fail": "{npc_name}试图捡起{object},但是失败了. 原因是{reason}"
9 | }
10 | }
--------------------------------------------------------------------------------
/example_project/config/action/put.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "put",
3 | "definition": ",把[object2]放入[object1]",
4 | "multi_param": true,
5 | "example": "、、",
6 | "log_template":{
7 | "success": "{npc_name}成功地把{parameters}放到了{object}里",
8 | "fail": "{npc_name}试图把{parameters}放到{object}里,但是失败了. 原因是{reason}"
9 | }
10 | }
--------------------------------------------------------------------------------
/example_project/config/action/release.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "release",
3 | "definition": ",释放某个角色",
4 | "multi_param": false,
5 | "example": "释放",
6 | "log_template":{
7 | "success": "{npc_name}成功释放了{object}",
8 | "fail": "{npc_name}试图释放{object},但是失败了. 原因是{reason}"
9 | }
10 | }
--------------------------------------------------------------------------------
/example_project/config/action/stand.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "stand",
3 | "definition": "空动作/静止,调用action失败时使用",
4 | "multi_param": false,
5 | "example": "",
6 | "log_template":{
7 | "success": "{npc_name}保持静止",
8 | "fail": "{npc_name}试图保持静止,但是失败了. 原因是{reason}"
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/example_project/config/action/talk.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "talk",
3 | "definition": ",以扮演的角色身份对[person]说话,内容是[content]",
4 | "multi_param": false,
5 | "example": "talk",
6 | "log_template":{
7 | "success": "{npc_name}对{object}说:{parameters}",
8 | "fail": "{npc_name}试图与{object}对话,但是失败了. 原因是{reason}"
9 | }
10 | }
--------------------------------------------------------------------------------
/example_project/config/action/use.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "use",
3 | "definition": "