Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

hotfix 2

Charles Packer0e1fdcd36017
diff --git a/memgpt/local_llm/chat_completion_proxy.py b/memgpt/local_llm/chat_completion_proxy.py
index cab33c89f..de9da221f 100644
--- a/memgpt/local_llm/chat_completion_proxy.py
+++ b/memgpt/local_llm/chat_completion_proxy.py
@@ -45,6 +45,9 @@ async def get_chat_completion(
except requests.exceptions.ConnectionError as e:
raise ValueError(f"Was unable to connect to host {HOST}")
+ if result is None or result == "":
+ raise Exception(f"Got back an empty response string from {HOST}")
+
chat_completion_result = llm_wrapper.output_to_chat_completion_response(result)
if DEBUG:
print(json.dumps(chat_completion_result, indent=2))
diff --git a/memgpt/local_llm/webui/api.py b/memgpt/local_llm/webui/api.py
index 2614050da..547377b1a 100644
--- a/memgpt/local_llm/webui/api.py
+++ b/memgpt/local_llm/webui/api.py
@@ -17,7 +17,7 @@ def get_webui_completion(prompt, settings=SIMPLE):
request["prompt"] = prompt
try:
- URI = f"{HOST}{WEBUI_API_SUFFIX}"
+ URI = f"{HOST.strip('/')}{WEBUI_API_SUFFIX}"
response = requests.post(URI, json=request)
if response.status_code == 200:
result = response.json()