forked from MineDojo/Voyager
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlearn.py
26 lines (22 loc) · 867 Bytes
/
learn.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from shared import fetch_credentials
from questllama.extensions.chat_interaction_provider import QuestllamaClientProvider
from shared.config import USE_QUESTLLAMA
from _voyager.extensions.chat_provider import VoyagerChatProvider
from _voyager import Voyager
if __name__ == "__main__":
# Get login credentials and launch the experiment.
azure_login, openai_api_key = fetch_credentials()
# Determine which client provider to use based on configuration
chat_provider_class = (
QuestllamaClientProvider if USE_QUESTLLAMA else VoyagerChatProvider
)
# Inject this class into the factory function
client = Voyager(
chat_provider=chat_provider_class,
azure_login=azure_login,
openai_api_key=openai_api_key,
resume=True,
max_iterations=180,
)
# start lifelong learning
client.learn()