From 2a53993f524df8528d88b7cbc79578408e8ec36b Mon Sep 17 00:00:00 2001 From: sunshinexcode <24xinhui@163.com> Date: Mon, 12 Aug 2024 21:14:18 +0800 Subject: [PATCH 1/2] fix(): fix graphNameMap not being able to retrieve environment variable values --- docker-compose.yml | 21 ++------------------- server/internal/config.go | 14 ++++++++++++-- server/main.go | 3 +++ 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 86b95e91..2614e35f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,25 +14,8 @@ services: - ./:/app - ${LOG_PATH}:${LOG_PATH} working_dir: /app - environment: - AGORA_APP_ID: ${AGORA_APP_ID} - AGORA_APP_CERTIFICATE: ${AGORA_APP_CERTIFICATE} - AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} - AWS_BEDROCK_MODEL: ${AWS_BEDROCK_MODEL} - AWS_REGION: ${AWS_REGION} - AZURE_STT_KEY: ${AZURE_STT_KEY} - AZURE_STT_REGION: ${AZURE_STT_REGION} - AZURE_TTS_KEY: ${AZURE_TTS_KEY} - AZURE_TTS_REGION: ${AZURE_TTS_REGION} - COSY_TTS_KEY: ${COSY_TTS_KEY} - ELEVENLABS_TTS_KEY: ${ELEVENLABS_TTS_KEY} - LITELLM_MODEL: ${LITELLM_MODEL} - OPENAI_API_KEY: ${OPENAI_API_KEY} - OPENAI_BASE_URL: ${OPENAI_BASE_URL} - OPENAI_MODEL: ${OPENAI_MODEL} - OPENAI_PROXY_URL: ${OPENAI_PROXY_URL} - QWEN_API_KEY: ${QWEN_API_KEY} + env_file: + - .env astra_playground: image: ghcr.io/rte-design/astra_playground:v0.2.0-15-g38e1738 container_name: astra_playground diff --git a/server/internal/config.go b/server/internal/config.go index f1cf6dca..ffbce550 100644 --- a/server/internal/config.go +++ b/server/internal/config.go @@ -131,8 +131,8 @@ var ( // The corresponding graph name based on the language graphNameMap = map[string]string{ - languageChinese: os.Getenv("GRAPH_NAME_ZH"), - languageEnglish: os.Getenv("GRAPH_NAME_EN"), + languageChinese: "va.openai.azure", + languageEnglish: "va.openai.azure", } // Retrieve parameters from the request and map them to the property.json file @@ -190,3 +190,13 @@ var ( }, } ) + +func SetGraphNameMap() { + if graphNameZH := os.Getenv("GRAPH_NAME_ZH"); graphNameZH != "" { + graphNameMap[languageChinese] = graphNameZH + } + + if graphNameEN := os.Getenv("GRAPH_NAME_EN"); graphNameEN != "" { + graphNameMap[languageEnglish] = graphNameEN + } +} diff --git a/server/main.go b/server/main.go index d590b89d..2bc4bd9c 100644 --- a/server/main.go +++ b/server/main.go @@ -48,6 +48,9 @@ func main() { os.Exit(1) } + // Set graph name map + internal.SetGraphNameMap() + // Process property.json if err = processProperty(internal.PropertyJsonFile); err != nil { slog.Error("process property.json failed", "err", err) From c17b1e48b23fb0810e7c4a20bcf66b5d86920daf Mon Sep 17 00:00:00 2001 From: sunshinexcode <24xinhui@163.com> Date: Mon, 12 Aug 2024 22:01:12 +0800 Subject: [PATCH 2/2] chore(): upgrade image version --- .devcontainer/devcontainer.json | 2 +- Dockerfile | 2 +- docker-compose.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2cece602..6aec5d28 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile { "name": "astra", - "image": "ghcr.io/rte-design/astra_agents_build:0.3.5", + "image": "ghcr.io/rte-design/astra_agents_build:0.3.6", "customizations": { "vscode": { "extensions": [ diff --git a/Dockerfile b/Dockerfile index a383ca16..dfac37fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/rte-design/astra_agents_build:0.3.5 AS builder +FROM ghcr.io/rte-design/astra_agents_build:0.3.6 AS builder ARG SESSION_CONTROL_CONF=session_control.conf diff --git a/docker-compose.yml b/docker-compose.yml index 2614e35f..179790ba 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: astra_agents_dev: - image: ghcr.io/rte-design/astra_agents_build:0.3.5 + image: ghcr.io/rte-design/astra_agents_build:0.3.6 container_name: astra_agents_dev platform: linux/amd64 tty: true @@ -23,7 +23,7 @@ services: ports: - "3000:3000" astra_graph_designer: - image: agoraio/astra_graph_designer:0.1.0 + image: agoraio/astra_graph_designer:0.3.0 container_name: astra_graph_designer restart: always ports: