• Stars
    star
    128
  • Rank 279,651 (Top 6 %)
  • Language
    C#
  • License
    GNU General Publi...
  • Created over 1 year ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

在Unity编辑器中使用ChatGPT、BingChat、GoogleBard来生成并执行代码。(Use ChatGPT, BingChat and GoogleBard to generate and execute code within the Unity editor.)

UniGPT English Doc

在Unity编辑器中使用ChatGPT、NewBing、GoogleBard来生成并执行代码。

输出文本支持流式传输


ChatGPT

chatgpt

New Bing

binggpt

Google Bard

bard

安装要求

Unity版本 >= 2019.3

初始化环境

  1. 进入Unity工程,等待Python环境初始化完成,然后 Edit -> Project Settings -> Python Scripting ->

    Launch Terminal (打开命令行工具)

    image-20230324020733689

  2. 按顺序执行以下命令

    python -m pip install --upgrade pip
    python -m pip install revChatGPT
    python -m pip install EdgeGPT
    python -m pip install GoogleBard
  3. 按照下面的教程配置AI

使用教程

配置 ChatGPT

  1. 获取 ChatGPT 的 api_key,具体参考:https://platform.openai.com/account/api-keys
  2. 编辑该Json配置:Assets/IntegrationGPT/Config~/chat_gpt_config.json
  3. 国内的可以参考这里部署个腾讯云函数:openai-api-proxy,然后替换掉配置中的 api_url 即可
{
  # 将获取到的 api_key 替换掉下面的
  "api_key": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  # chatgpt使用的模型, 如果你是Plus用户, 可以修改模型为 gpt-4
  "model": "gpt-3.5-turbo",
  # 代理设置,如果不需要则删除,在国内的必须要设置,否则无法访问openai的api
  "proxy": "http://127.0.0.1:1080",
  # 如果有国内镜像的,可以将api地址填写在这里
  # 官方API:https://api.openai.com/v1/chat/completions
  "api_url": "",
  # 这个是ChatGPT的提示语,可以根据需要增删
  "prompt": {
    "聊天": "",
	"生成并执行代码": "我想让你在Unity里面实现一个需求, 然后你给我回复代码, 你需要将实现逻辑写在TemplateClass中的Test静态方法里面, 我希望我不需要设置任何东西, 只手动调用Test方法后就能得到正确的结果, 我希望你只回复代码, 而不是其他任何内容, 不要注释.\n我的第一个需求是\n"
  }
}

配置 New Bing

  1. 首先确保你已经加入了 New Bing,具体参考:https://github.com/acheong08/EdgeGPT#checking-access-required

  2. 然后获取 cookies,具体参考:https://github.com/acheong08/EdgeGPT#getting-authentication-required

  3. 将获取的 cookies 拷贝到 Assets/IntegrationGPT/Config~/new_bing_cookies.json 中

  4. 编辑该Json配置:Assets/IntegrationGPT/Config~/new_bing_config.json

    {
      # 对话样式
      # 更具创造力:creative 平衡:balanced 精确:precise
      "style": "precise",
      # 代理设置,如果不需要则删除,在国内的必须要设置,否则无法访问bing的api
      "proxy": "http://127.0.0.1:1080",
      # 如果有国内镜像的,可以将api地址填写在这里
      # 官方API:https://edgeservices.bing.com/edgesvc/turing/conversation/create
      "api_url": "",
      # 这个是Bing的提示语,可以根据需要增删
      "prompts": {
        "聊天": "",
        "生成并执行代码": "我想让你在Unity里面实现一个需求, 然后你给我回复代码, 你需要将实现逻辑写在TemplateClass中的Test静态方法里面, 并正确引用命名空间, 我希望我不需要设置任何东西, 只手动调用Test方法后就能得到正确的结果,我希望你只回复代码, 而不是其他任何内容, 不要注释.\n我的第一个需求是\n"
      }
    }

配置 Google Bard

  1. 首先确保你已经加入了 Google Bard

  2. 然后获取session,具体参考:https://github.com/acheong08/Bard#authentication

  3. 编辑该Json配置:Assets/IntegrationGPT/Config~/google_bard_config.json

    {
        # google bard 的 session
        "session": "",
         # 代理设置,如果不需要则删除,在国内的必须要设置,否则无法访问google的api
        "proxy": "",
        # 这个是Google Bard的提示语,可以根据需要增删
        "prompts":{
            "Chat": ""
        }
    }

引用

More Repositories

1

UniHacker

Patch all versions of Unity3D and UnityHub for Windows, MacOS, Linux and Docker.
C#
2,821
star
2

SETUNA2

A best screenshot small tool (support high dpi screenshots) 一款好用的截图小工具(支持高分屏截图)
C#
849
star
3

unihacker-docker

UniHacker for Docker
C#
33
star
4

psd2ugui

Parse the PSD file and generate the ugui panel. 解析psd文件并生成ugui面板
C#
24
star
5

CrackUnityHub

C#
24
star
6

AutomaticGamepad

Write automated scripts for Xbox or PlayStation console games
C#
15
star
7

chatgpt-qqbot

QQ机器人版的ChatGPT
Python
13
star
8

hybridclr_stack_trace

C++
5
star
9

UIRecycleListForUGUI

无限滚动的List(UGUI版)
C#
5
star
10

.Net_BinaryAnalyzer

该软件用于分析通过BinaryFormatter序列化后的.Net对象(Parse .Net serialization)
C#
4
star
11

AndroidLogCatWindow

Unity下的Android ADB日志查看工具
C#
4
star
12

MemberEditor

(有点庞大)该调试工具能够快速的访问脚本对象的所有成员,并快速对其进行操作,来达到快速调试目的(Unity3D)
C#
3
star
13

BuiltInResourcesWindow

Unity下的图标资源查看器(搬运自wiki.unity3d.com)
C#
2
star
14

UnityYamlResolver

解决Transform同名时找不到该组件的问题(没什么卵用)
C#
2
star
15

RecycleEditorWindow

EditorWindow上的无限滚动,上万条数据滑动不卡顿,超流畅
C#
2
star
16

psd2ugui.extension

psd2ugui extension panel. psd2ugui扩展面板
JavaScript
1
star
17

UIRecycleTable

不等距的无限滚动
C#
1
star
18

GenericMenuExtensions

EditorWindow下的右键菜单链式编程(搬运自wiki.unity3d.com)
C#
1
star
19

MyBMFontTool

用于解决BMFont的导入图片步骤比较繁琐
C#
1
star
20

PIDViewer

查看前台进程相关信息的小工具
C#
1
star
21

psd2ugui.ts

TypeScript
1
star
22

UnityEventListener

C#
1
star
23

UnityStepPlayTool

Unity的逐帧播放工具,可以设定间隔来自动逐帧播放
C#
1
star
24

UnityECS2

纯ECS(pure ecs)
C#
1
star