diff --git a/.github/workflows/push-image.yml b/.github/workflows/push-image.yml index ee2ca1c..4088acc 100644 --- a/.github/workflows/push-image.yml +++ b/.github/workflows/push-image.yml @@ -92,8 +92,11 @@ jobs: # The ENV_FILE_CONTENTS contains API keys, like LITERAL_API_KEY and OPENAI_API_KEY # As such, make sure the built image is not publicly accessible cd ${{ inputs.dockerfile_folder }} - echo "${{ secrets[env.SECRET_NAME] }}" > .env - wc .env + # TODO: Remove conditional once "Initialize app" step works + if [ "${{ inputs.dockerfile_folder }}" != "05-assistive-chatbot" ]; then + echo "${{ secrets[env.SECRET_NAME] }}" > .env + wc .env + fi - name: "Build image: ${{ github.sha }}" if: inputs.build_image @@ -180,4 +183,15 @@ jobs: fi done + + - name: "Initialize app" + if: inputs.deploy_image + run: | + # The ENV_FILE_CONTENTS contains API keys, like LITERAL_API_KEY and OPENAI_API_KEY + # As such, make sure the built image is not publicly accessible + echo "${{ secrets[env.SECRET_NAME] }}" > .env + + SVC_URL=$(aws lightsail get-container-services --service-name "$SERVICE_NAME" | jq -r '.containerServices[0].url') + curl -X POST "$SVC_URL/initenvs" --data-binary '@.env' + # TODO: warm up vector DB on startup diff --git a/05-assistive-chatbot/chatbot/llms/groq_client.py b/05-assistive-chatbot/chatbot/llms/groq_client.py index 5a65f08..7d941e8 100644 --- a/05-assistive-chatbot/chatbot/llms/groq_client.py +++ b/05-assistive-chatbot/chatbot/llms/groq_client.py @@ -24,6 +24,7 @@ def __init__(self, model_name, settings): self.model_name = model_name self.settings = settings logger.info("Creating LLM client '%s' with %s", model_name, self.settings) + # TODO: remove temperature from settings self.client = Groq(**self.settings) def generate_reponse(self, message):