From baec9b4adbc3ffa8b71ca129c4c35fc5f7932c19 Mon Sep 17 00:00:00 2001 From: kristol07 Date: Sun, 27 Oct 2024 12:05:18 +0800 Subject: [PATCH] fix: environment example and property json to better support custom openai key & model --- .env.example | 1 + agents/property.json | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.env.example b/.env.example index 4713a75f..3a0452d8 100644 --- a/.env.example +++ b/.env.example @@ -86,6 +86,7 @@ LITELLM_MODEL=gpt-4o-mini # Extension: openai_chatgpt # OpenAI API key OPENAI_API_KEY= +OPENAI_MODEL=gpt-4o-mini # OpenAI API key for realtime API OPENAI_REALTIME_API_KEY= diff --git a/agents/property.json b/agents/property.json index 5b6f46a9..cbc17929 100644 --- a/agents/property.json +++ b/agents/property.json @@ -173,15 +173,15 @@ "extension_group": "chatgpt", "name": "openai_chatgpt", "property": { - "api_key": "$OPENAI_API_KEY", - "base_url": "", + "api_key": "${env:OPENAI_API_KEY}", + "base_url": "${env:OPENAI_API_BASE}", "frequency_penalty": 0.9, "greeting": "TEN Agent connected. How can I help you today?", "max_memory_length": 10, "max_tokens": 512, - "model": "gpt-4o-mini", + "model": "${env:OPENAI_MODEL}", "prompt": "", - "proxy_url": "$OPENAI_PROXY_URL" + "proxy_url": "${env:OPENAI_PROXY_URL}" }, "type": "extension" }, @@ -258,10 +258,10 @@ "addon": "openai_chatgpt", "name": "openai_chatgpt", "property": { - "base_url": "", + "base_url": "${env:OPENAI_API_BASE}", "api_key": "${env:OPENAI_API_KEY}", "frequency_penalty": 0.9, - "model": "gpt-4o-mini", + "model": "${env:OPENAI_MODEL}", "max_tokens": 512, "prompt": "", "proxy_url": "${env:OPENAI_PROXY_URL}", @@ -457,10 +457,10 @@ "addon": "openai_chatgpt", "name": "openai_chatgpt", "property": { - "base_url": "", + "base_url": "${env:OPENAI_API_BASE}", "api_key": "${env:OPENAI_API_KEY}", "frequency_penalty": 0.9, - "model": "gpt-4o-mini", + "model": "${env:OPENAI_MODEL}", "max_tokens": 512, "prompt": "", "proxy_url": "${env:OPENAI_PROXY_URL}", @@ -662,10 +662,10 @@ "addon": "openai_chatgpt", "name": "openai_chatgpt", "property": { - "base_url": "", + "base_url": "${env:OPENAI_API_BASE}", "api_key": "${env:OPENAI_API_KEY}", "frequency_penalty": 0.9, - "model": "gpt-4o-mini", + "model": "${env:OPENAI_MODEL}", "max_tokens": 512, "prompt": "", "proxy_url": "${env:OPENAI_PROXY_URL}", @@ -1021,10 +1021,10 @@ "addon": "openai_chatgpt_python", "name": "openai_chatgpt", "property": { - "base_url": "", + "base_url": "${env:OPENAI_API_BASE}", "api_key": "${env:OPENAI_API_KEY}", "frequency_penalty": 0.9, - "model": "gpt-4o-mini", + "model": "${env:OPENAI_MODEL}", "max_tokens": 512, "prompt": "", "proxy_url": "${env:OPENAI_PROXY_URL}", @@ -1850,10 +1850,10 @@ "addon": "openai_chatgpt_python", "name": "openai_chatgpt", "property": { - "base_url": "", + "base_url": "${env:OPENAI_API_BASE}", "api_key": "${env:OPENAI_API_KEY}", "frequency_penalty": 0.9, - "model": "gpt-4o", + "model": "${env:OPENAI_MODEL}", "max_tokens": 512, "prompt": "", "proxy_url": "${env:OPENAI_PROXY_URL}",