MineDojo / Voyager

An Open-Ended Embodied Agent with Large Language Models
https://voyager.minedojo.org/
MIT License
5.53k stars 512 forks source link

Question about `control_primitives` and `control_primitives_context` #29

Closed taoisu closed 1 year ago

taoisu commented 1 year ago

There seem to be functions of the same name under the two folders, one folder is used for skill manager agent while the other is used for action agent, I'm wondering what is the reason two function implementations of the same name is needed? Could anyone help me understand?

xieleo5 commented 1 year ago

Hi, thanks for your interest in this project! This is a trick we use to shorten the context:

The control_primitives refer to the actual functions that are executed on the JavaScript side. To provide the bot with environmental feedback, we incorporate multiple safeguards and chat messages.

On the other hand, the control_primitives_context contains functions that are displayed within GPT's context. They serve as examples for GPT on how to utilize the Mineflayer API and our control primitives. We don't want GPT to see those if...else safeguards.

taoisu commented 1 year ago

You're awesome! @xieleo5 Thanks!