From c0402d49894ce097eaa0aa27383c724969037819 Mon Sep 17 00:00:00 2001 From: Julep Developers Date: Sat, 14 Sep 2024 03:13:32 +0000 Subject: [PATCH] fix: Misc fixes --- agents-api/agents_api/env.py | 24 +++++++++---------- .../agents_api/routers/sessions/chat.py | 6 +++-- agents-api/docker-compose.yml | 1 + embedding-service/docker-compose.yml | 4 ---- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/agents-api/agents_api/env.py b/agents-api/agents_api/env.py index aa2254e51..85d33f0e6 100644 --- a/agents-api/agents_api/env.py +++ b/agents-api/agents_api/env.py @@ -99,15 +99,15 @@ testing=testing, ) -# if debug or testing: -# Print the loaded environment variables for debugging purposes. -print("Environment variables:") -pprint(environment) -print() - -# Yell if testing is enabled -print("@" * 80) -print( - f"@@@ Running in {'testing' if testing else 'debug'} mode. This should not be enabled in production. @@@" -) -print("@" * 80) +if debug or testing: + # Print the loaded environment variables for debugging purposes. + print("Environment variables:") + pprint(environment) + print() + + # Yell if testing is enabled + print("@" * 80) + print( + f"@@@ Running in {'testing' if testing else 'debug'} mode. This should not be enabled in production. @@@" + ) + print("@" * 80) diff --git a/agents-api/agents_api/routers/sessions/chat.py b/agents-api/agents_api/routers/sessions/chat.py index 2a744bada..87713c56b 100644 --- a/agents-api/agents_api/routers/sessions/chat.py +++ b/agents-api/agents_api/routers/sessions/chat.py @@ -47,9 +47,11 @@ async def chat( chat_context.merge_settings(chat_input) settings: dict = chat_context.settings.model_dump() env: dict = chat_context.get_chat_environment() + settings["model"] = f"openai/{settings['model']}" # litellm proxy idiosyncracy + + # Render the messages new_raw_messages = [msg.model_dump() for msg in chat_input.messages] - # Render the messages past_messages, doc_references = await gather_messages( developer=developer, session_id=session_id, @@ -73,7 +75,7 @@ async def chat( # Get the response from the model model_response = await litellm.acompletion( messages=messages, - tools=tools, + tools=tools or None, user=str(developer.id), # For tracking usage tags=developer.tags, # For filtering models in litellm **settings, diff --git a/agents-api/docker-compose.yml b/agents-api/docker-compose.yml index f1f00e18f..67273126e 100644 --- a/agents-api/docker-compose.yml +++ b/agents-api/docker-compose.yml @@ -6,6 +6,7 @@ x--shared-environment: &shared-environment AGENTS_API_KEY_HEADER_NAME: ${AGENTS_API_KEY_HEADER_NAME:-Authorization} AGENTS_API_HOSTNAME: ${AGENTS_API_HOSTNAME:-localhost} AGENTS_API_PROTOCOL: ${AGENTS_API_PROTOCOL:-http} + AGENTS_API_PUBLIC_PORT: ${AGENTS_API_PUBLIC_PORT:-80} AGENTS_API_URL: ${AGENTS_API_URL:-http://agents-api:8080} COZO_AUTH_TOKEN: ${COZO_AUTH_TOKEN} COZO_HOST: ${COZO_HOST:-http://memory-store:9070} diff --git a/embedding-service/docker-compose.yml b/embedding-service/docker-compose.yml index 58d702c27..b6b96c6b3 100644 --- a/embedding-service/docker-compose.yml +++ b/embedding-service/docker-compose.yml @@ -42,10 +42,6 @@ services: profiles: - '' # Acts as a default profile. See: https://stackoverflow.com/questions/75758174/how-to-make-profile-default-for-docker-compose - cpu - # - # Note: Adding these for convenience so this runs when `docker compose up` is run - - multi-tenant - - temporal-ui platform: linux/amd64 # Temp fix for Mac M-series chips text-embeddings-inference-gpu: