From 62c95dba26216611151f08a10c3fced41438a750 Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Thu, 15 Feb 2024 11:02:51 -0800 Subject: [PATCH] update openai example to use memgpt server --- examples/openai_client_assistants.py | 6 ++---- memgpt/server/rest_api/openai_assistants/assistants.py | 8 -------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/examples/openai_client_assistants.py b/examples/openai_client_assistants.py index e6c82ee08a..ca21451d69 100644 --- a/examples/openai_client_assistants.py +++ b/examples/openai_client_assistants.py @@ -4,14 +4,12 @@ """ This script provides an example of how you can use OpenAI's python client with a MemGPT server. -Before running this example, make sure you start the OpenAI-compatible REST server: - cd memgpt/server/rest_api/openai_assistants - poetry run uvicorn assistants:app --reload --port 8080 +Before running this example, make sure you start the OpenAI-compatible REST server with `memgpt server`. """ def main(): - client = OpenAI(base_url="http://127.0.0.1:8080/v1") + client = OpenAI(base_url="http://localhost:8283/v1") # create assistant (creates a memgpt preset) assistant = client.beta.assistants.create( diff --git a/memgpt/server/rest_api/openai_assistants/assistants.py b/memgpt/server/rest_api/openai_assistants/assistants.py index 6b13767342..6336b61052 100644 --- a/memgpt/server/rest_api/openai_assistants/assistants.py +++ b/memgpt/server/rest_api/openai_assistants/assistants.py @@ -37,14 +37,6 @@ from memgpt.data_types import LLMConfig, EmbeddingConfig, Message from memgpt.constants import DEFAULT_PRESET -""" -Basic REST API sitting on top of the internal MemGPT python server (SyncServer) - -Start the server with: - cd memgpt/server/rest_api/openai_assistants - poetry run uvicorn assistants:app --reload --port 8080 -""" - router = APIRouter()