From cc84d46d8b2a2e012de58a86d8d2f60b7a9b03ba Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Mon, 30 Oct 2023 14:14:52 -0700 Subject: [PATCH] added more clear warnings for when HOST and HOST_TYPE are not set (#202) --- memgpt/local_llm/chat_completion_proxy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/memgpt/local_llm/chat_completion_proxy.py b/memgpt/local_llm/chat_completion_proxy.py index 0497a6fe..4d9e82e6 100644 --- a/memgpt/local_llm/chat_completion_proxy.py +++ b/memgpt/local_llm/chat_completion_proxy.py @@ -21,6 +21,11 @@ async def get_chat_completion( functions, function_call="auto", ): + if HOST is None: + raise ValueError(f"The OPENAI_API_BASE environment variable is not defined. Please set it in your environment.") + if HOST_TYPE is None: + raise ValueError(f"The BACKEND_TYPE environment variable is not defined. Please set it in your environment.") + if function_call != "auto": raise ValueError(f"function_call == {function_call} not supported (auto only)")