Skip to content

Commit

Permalink
fix: add back memgpt/configs folder (#1431)
Browse files Browse the repository at this point in the history
Co-authored-by: cpacker <packercharles@gmail.com>
  • Loading branch information
sarahwooders and cpacker authored Jun 4, 2024
1 parent 0eef95f commit f8eb5d8
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
8 changes: 4 additions & 4 deletions memgpt/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def quickstart(

# Load the file from the relative path
script_dir = os.path.dirname(__file__) # Get the directory where the script is located
backup_config_path = os.path.join(script_dir, "..", "..", "configs", "memgpt_hosted.json")
backup_config_path = os.path.join(script_dir, "..", "configs", "memgpt_hosted.json")
try:
with open(backup_config_path, "r", encoding="utf-8") as file:
backup_config = json.load(file)
Expand All @@ -175,7 +175,7 @@ def quickstart(
# Load the file from the relative path
script_dir = os.path.dirname(__file__) # Get the directory where the script is located
# print("SCRIPT", script_dir)
backup_config_path = os.path.join(script_dir, "..", "..", "configs", "memgpt_hosted.json")
backup_config_path = os.path.join(script_dir, "..", "configs", "memgpt_hosted.json")
# print("FILE PATH", backup_config_path)
try:
with open(backup_config_path, "r", encoding="utf-8") as file:
Expand Down Expand Up @@ -214,7 +214,7 @@ def quickstart(

# Load the file from the relative path
script_dir = os.path.dirname(__file__) # Get the directory where the script is located
backup_config_path = os.path.join(script_dir, "..", "..", "configs", "openai.json")
backup_config_path = os.path.join(script_dir, "..", "configs", "openai.json")
try:
with open(backup_config_path, "r", encoding="utf-8") as file:
backup_config = json.load(file)
Expand All @@ -226,7 +226,7 @@ def quickstart(
else:
# Load the file from the relative path
script_dir = os.path.dirname(__file__) # Get the directory where the script is located
backup_config_path = os.path.join(script_dir, "..", "..", "configs", "openai.json")
backup_config_path = os.path.join(script_dir, "..", "configs", "openai.json")
try:
with open(backup_config_path, "r", encoding="utf-8") as file:
backup_config = json.load(file)
Expand Down
11 changes: 11 additions & 0 deletions memgpt/configs/memgpt_hosted.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"context_window": 8192,
"model_endpoint_type": "openai",
"model_endpoint": "https://inference.memgpt.ai",
"model": "memgpt-openai",
"embedding_endpoint_type": "hugging-face",
"embedding_endpoint": "https://embeddings.memgpt.ai",
"embedding_model": "BAAI/bge-large-en-v1.5",
"embedding_dim": 1024,
"embedding_chunk_size": 300
}
12 changes: 12 additions & 0 deletions memgpt/configs/openai.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"context_window": 8192,
"model": "gpt-4",
"model_endpoint_type": "openai",
"model_endpoint": "https://api.openai.com/v1",
"model_wrapper": null,
"embedding_endpoint_type": "openai",
"embedding_endpoint": "https://api.openai.com/v1",
"embedding_model": "text-embedding-ada-002",
"embedding_dim": 1536,
"embedding_chunk_size": 300
}
17 changes: 17 additions & 0 deletions tests/test_quickstart.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from memgpt.cli.cli import QuickstartChoice, quickstart
from memgpt.config import MemGPTConfig


def test_quickstart():

# openai
quickstart(QuickstartChoice.openai, debug=True, terminal=False)
config = MemGPTConfig.load()
assert config.default_llm_config.model_endpoint_type == "openai"
assert config.default_embedding_config.embedding_endpoint_type == "openai"

# memgpt
quickstart(QuickstartChoice.memgpt_hosted, debug=True, terminal=False)
config = MemGPTConfig.load()
assert config.default_llm_config.model_endpoint == "https://inference.memgpt.ai"
assert config.default_embedding_config.embedding_endpoint == "https://embeddings.memgpt.ai"

0 comments on commit f8eb5d8

Please sign in to comment.