1 Star 0 Fork 0

常远 / AgentWorld

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

Agent-World

map of the game

This repo contains two things:

  • A simple RPG-like environment for an LLM-enabled AI Agent to exist in
  • A simple AI Agent connected to the OpenAI API to exist in that environment

It is intended as a proof of concept.

Running

GPTRPG is intended to be run locally. To run:

  1. Make sure you have updated the agent/env.json file with your IFLYTEK API key.
  2. Only tested with node 16.19.0
  3. In the gptrpg directory run npm install to install dependencies for all projects.
  4. Then run npm start in the root directory. This will start the agent and the front-end. The front-end will be available at http://localhost:3000.

The Environment

Code for the environment lives in the ui-admin directory. It is a React project.

The environment was made with Tiled map editor. The files live in ui-admin/src/assets.

The environment is rendered with Phaser and the Grid Engine Plugin

The environment consists of:

  • The character (agent)
  • Impassable tiles
  • A plant layer with "plantable" tiles, and plants (not currently in use by agent). Player can plant food on plantable tiles with S key and harvest food with D key.

The Agent

Code for the agent lives in the agent directory.

The agent is a simple AI agent that uses the OpenAI API to make decisions. It communicates with the front-end via a websocket.

The agent is provided with a list of possible actions, the state of its surroundings, and its internal state (currently only sleepiness is measured).

Todo List

上下左右移动窗口

把agent初始位置等参数做成可配置的参数

agent接收到控制指令后,不只是走一步,而是一直走

和大模型的互动改成触发式的

在界面上做一个显示窗,显示大模型的控制结果

优化稳定性,解决requestObj.sparkResult += data.payload.choices.text[0].content,TypeError: Cannot read properties of undefined (reading 'choices')的问题

创建两个角色,一个角色可以用上下左右控制,另一个角色是大模型自主控制

加一个check环节,检查大模型返回的值是否符合预期

加一个log文件,把每次试验的结果都用log记录下来。

改正上下左右控制agent报错的bug

Upcoming features

  • Multi agent support
  • More agent actions (drink, eat, plant food, harvest food, write poetry, etc.)
  • More agent states (hunger, thirst, etc.)
  • Agent memory
  • Agent goals
  • Agent inventory
  • Deployment to web
  • Human controlled character
  • UI enhancements (agent state, human interactions, etc.)
BSD 3-Clause License Copyright (c) 2023, 常远 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

许多agent生活的一个世界。Agent由大模型控制,自主感知环境和决策行为。 展开 收起
JavaScript 等 3 种语言
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/cy_universe/agent-world.git
git@gitee.com:cy_universe/agent-world.git
cy_universe
agent-world
AgentWorld
master

搜索帮助