docs: Update OpenAI assistants example to use memgpt server (#1012)

This commit is contained in:
Sarah Wooders
2024-02-15 11:44:36 -08:00
committed by GitHub
parent 6ea67d4cd7
commit 60cd5ec56b
2 changed files with 2 additions and 12 deletions

View File

@@ -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(

View File

@@ -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()