diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index a925a9b..c68f870 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -61,6 +61,7 @@ jobs: GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} + ADS_SERVER_URL: ${{ secrets.ADS_SERVER_URL }} steps: - uses: actions/checkout@v3 # This is to fix GIT not liking owner of the checkout dir - https://github.com/actions/runner/issues/2033#issuecomment-1204205989 diff --git a/scripts/deploy_backend.sh b/scripts/deploy_backend.sh index d684a58..4f3f74d 100755 --- a/scripts/deploy_backend.sh +++ b/scripts/deploy_backend.sh @@ -56,6 +56,12 @@ then exit -1 fi +if test -z "$ADS_SERVER_URL" +then + echo "ERROR: ADS_SERVER_URL variable must be defined, exiting" + exit -1 +fi + echo "INFO: stopping already running docker container" ssh -o StrictHostKeyChecking=no -i key.pem azureuser@"$BACKEND_DOMAIN" "docker stop wasp-backend || echo 'No containers available to stop'" ssh -o StrictHostKeyChecking=no -i key.pem azureuser@"$BACKEND_DOMAIN" "docker container prune -f || echo 'No stopped containers to delete'" @@ -69,4 +75,4 @@ echo "Deleting old image" ssh -o StrictHostKeyChecking=no -i key.pem azureuser@"$BACKEND_DOMAIN" "docker system prune -f || echo 'No images to delete'" echo "INFO: starting docker container" -ssh -o StrictHostKeyChecking=no -i key.pem azureuser@"$BACKEND_DOMAIN" "docker run --name wasp-backend -p $PORT:$PORT -e PORT='$PORT' -e DATABASE_URL='$DATABASE_URL' -e WASP_WEB_CLIENT_URL='$WASP_WEB_CLIENT_URL' -e JWT_SECRET='$JWT_SECRET' -e GOOGLE_CLIENT_ID='$GOOGLE_CLIENT_ID' -e GOOGLE_CLIENT_SECRET='$GOOGLE_CLIENT_SECRET' -e AZURE_OPENAI_API_KEY='$AZURE_OPENAI_API_KEY' -d ghcr.io/$GITHUB_REPOSITORY:$TAG" +ssh -o StrictHostKeyChecking=no -i key.pem azureuser@"$BACKEND_DOMAIN" "docker run --name wasp-backend -p $PORT:$PORT -e PORT='$PORT' -e DATABASE_URL='$DATABASE_URL' -e WASP_WEB_CLIENT_URL='$WASP_WEB_CLIENT_URL' -e JWT_SECRET='$JWT_SECRET' -e GOOGLE_CLIENT_ID='$GOOGLE_CLIENT_ID' -e GOOGLE_CLIENT_SECRET='$GOOGLE_CLIENT_SECRET' -e AZURE_OPENAI_API_KEY='$AZURE_OPENAI_API_KEY' -e ADS_SERVER_URL='$ADS_SERVER_URL' -d ghcr.io/$GITHUB_REPOSITORY:$TAG" diff --git a/src/server/actions.ts b/src/server/actions.ts index 5b02785..6170f3a 100644 --- a/src/server/actions.ts +++ b/src/server/actions.ts @@ -218,7 +218,7 @@ export const getAgentResponse: GetAgentResponse = async ( }; try { - const response = await fetch(`${ADS_SERVER_URL}/conversation`, { + const response = await fetch(`${ADS_SERVER_URL}/chat`, { method: 'POST', headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload),