Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add openai_api_base option #70

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions voyager/voyager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(
azure_login: Dict[str, str] = None,
server_port: int = 3000,
openai_api_key: str = None,
openai_api_base: str = "https://api.openai.com/v1",
env_wait_ticks: int = 20,
env_request_timeout: int = 600,
max_iterations: int = 160,
Expand Down Expand Up @@ -59,6 +60,7 @@ def __init__(
:param azure_login: minecraft login config
:param server_port: mineflayer port
:param openai_api_key: openai api key
:param openai_api_base: openai base url
:param env_wait_ticks: how many ticks at the end each step will wait, if you found some chat log missing,
you should increase this value
:param env_request_timeout: how many seconds to wait for each step, if the code execution exceeds this time,
Expand Down Expand Up @@ -113,6 +115,9 @@ def __init__(

# set openai api key
os.environ["OPENAI_API_KEY"] = openai_api_key

# set openai base url
os.environ["OPENAI_API_BASE"] = openai_api_base

# init agents
self.action_agent = ActionAgent(
Expand Down