From 60cd5ec56b4b52ac718189a7cd53e09708c526cb Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Thu, 15 Feb 2024 11:44:36 -0800 Subject: [PATCH] docs: Update OpenAI assistants example to use `memgpt server` (#1012) --- 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 e6c82ee0..ca21451d 100644 --- a/examples/openai_client_assistants.py +++ b/examples/openai_client_assistants.py @@ -4,14 +4,12 @@ import time """ 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 6b137673..6336b610 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.models.openai import ( 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()