feat: chat playground backend integration

This commit is contained in:
Timothy J. Baek
2024-03-02 18:16:02 -08:00
parent 656f8dab05
commit 901e7a33fa
5 changed files with 259 additions and 81 deletions

View File

@@ -211,6 +211,17 @@ if ENV == "prod":
if OLLAMA_API_BASE_URL == "/ollama/api":
OLLAMA_API_BASE_URL = "http://host.docker.internal:11434/api"
OLLAMA_BASE_URL = os.environ.get("OLLAMA_BASE_URL", "")
if OLLAMA_BASE_URL == "":
OLLAMA_BASE_URL = (
OLLAMA_API_BASE_URL[:-4]
if OLLAMA_API_BASE_URL.endswith("/api")
else OLLAMA_API_BASE_URL
)
####################################
# OPENAI_API
####################################