From af9aae7afa5a84afac2023654ac5a48f1778f65c Mon Sep 17 00:00:00 2001 From: sunshinexcode <24xinhui@163.com> Date: Tue, 6 Aug 2024 14:11:50 +0800 Subject: [PATCH] fix(): fix api_key --- agents/addon/extension/litellm_python/litellm.py | 3 ++- agents/property.json.example | 1 + docker-compose.yml | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/agents/addon/extension/litellm_python/litellm.py b/agents/addon/extension/litellm_python/litellm.py index 8199fbff9..1c78ccd2f 100644 --- a/agents/addon/extension/litellm_python/litellm.py +++ b/agents/addon/extension/litellm_python/litellm.py @@ -32,7 +32,7 @@ def __init__(self, def default_config(cls): return cls( api_key="", - base_url="https://api.openai.com/v1", + base_url="", max_tokens=512, model="gpt-4o-mini", prompt="You are a voice assistant who talks in a conversational way and can chat with me like my friends. I will speak to you in English or Chinese, and you will answer in the corrected and improved version of my text with the language I use. Don’t talk like a robot, instead I would like you to talk like a real human with emotions. I will use your answer for text-to-speech, so don’t return me any meaningless characters. I want you to be helpful, when I’m asking you for advice, give me precise, practical and useful advice instead of being vague. When giving me a list of options, express the options in a narrative way instead of bullet points.", @@ -51,6 +51,7 @@ def __init__(self, config: LiteLLMConfig): def get_chat_completions_stream(self, messages: List[Dict[str, str]]): kwargs = { + "api_key": self.config.api_key, "base_url": self.config.base_url, "custom_llm_provider": self.config.provider, "frequency_penalty": self.config.frequency_penalty, diff --git a/agents/property.json.example b/agents/property.json.example index dd3b953bd..aa874a7df 100644 --- a/agents/property.json.example +++ b/agents/property.json.example @@ -1211,6 +1211,7 @@ "max_memory_length": 10, "max_tokens": 512, "model": "gpt-3.5-turbo", + "presence_penalty": 0.9, "prompt": "", "provider": "openai", "temperature": 0.1, diff --git a/docker-compose.yml b/docker-compose.yml index 409b5ca6b..c175fec98 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,6 +27,9 @@ services: AZURE_TTS_REGION: ${AZURE_TTS_REGION} COSY_TTS_KEY: ${COSY_TTS_KEY} ELEVENLABS_TTS_KEY: ${ELEVENLABS_TTS_KEY} + LITELLM_API_KEY: ${LITELLM_API_KEY} + LITELLM_MODEL: ${LITELLM_MODEL} + LITELLM_PROVIDER: ${LITELLM_PROVIDER} OPENAI_API_KEY: ${OPENAI_API_KEY} OPENAI_BASE_URL: ${OPENAI_BASE_URL} OPENAI_MODEL: ${OPENAI_MODEL}