mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-17 15:35:21 +02:00
Create __init__.py
This commit is contained in:
parent
ce4cc624a9
commit
70f3ebfc4f
1 changed files with 18 additions and 0 deletions
18
metagpt/actions/minecraft/control_primitives/__init__.py
Normal file
18
metagpt/actions/minecraft/control_primitives/__init__.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import pkg_resources
|
||||
import os
|
||||
import voyager.utils as U
|
||||
|
||||
|
||||
def load_control_primitives(primitive_names=None):
|
||||
package_path = pkg_resources.resource_filename("voyager", "")
|
||||
if primitive_names is None:
|
||||
primitive_names = [
|
||||
primitives[:-3]
|
||||
for primitives in os.listdir(f"{package_path}/control_primitives")
|
||||
if primitives.endswith(".js")
|
||||
]
|
||||
primitives = [
|
||||
U.load_text(f"{package_path}/control_primitives/{primitive_name}.js")
|
||||
for primitive_name in primitive_names
|
||||
]
|
||||
return primitives
|
||||
Loading…
Add table
Add a link
Reference in a new issue