From 919fd42d55d59a19245b12ebd6cdcc35066c2d13 Mon Sep 17 00:00:00 2001 From: Devis Battisti Date: Wed, 15 Jan 2025 11:37:38 +0100 Subject: [PATCH 1/2] feat: question lenght validation (#1299) --- apps/chatbot/src/app/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/chatbot/src/app/main.py b/apps/chatbot/src/app/main.py index 8d64f1829..30eaae0ae 100644 --- a/apps/chatbot/src/app/main.py +++ b/apps/chatbot/src/app/main.py @@ -14,7 +14,7 @@ from botocore.exceptions import BotoCoreError, ClientError from fastapi import FastAPI, HTTPException, Header from starlette.middleware.cors import CORSMiddleware -from pydantic import BaseModel +from pydantic import BaseModel, Field from src.modules.chatbot import Chatbot @@ -28,11 +28,11 @@ class QueryFromThePast(BaseModel): id: str | None = None - question: str + question: str = Field(max_length=800) answer: str | None = None class Query(BaseModel): - question: str + question: str = Field(max_length=800) queriedAt: str | None = None history: List[QueryFromThePast] | None = None From f25042c04060d25acc747087d85bd1235d30358a Mon Sep 17 00:00:00 2001 From: christian-calabrese Date: Wed, 15 Jan 2025 12:26:51 +0100 Subject: [PATCH 2/2] Fix chatbot lambda deploy (#1302) * feat: add ecs variables for active campaign * fix: missing env in set lambda function image step * fix: revert --- .github/workflows/deploy_chatbot.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy_chatbot.yaml b/.github/workflows/deploy_chatbot.yaml index f95189960..551b8aced 100644 --- a/.github/workflows/deploy_chatbot.yaml +++ b/.github/workflows/deploy_chatbot.yaml @@ -86,6 +86,8 @@ jobs: provenance: false - name: AWS set lambda function image + env: + CHATBOT_LAMBDA_NAME: ${{ vars.CHATBOT_LAMBDA_NAME }} run: | aws lambda update-function-code --function-name ${{ env.CHATBOT_LAMBDA_NAME }} --image-uri ${{ steps.login-ecr.outputs.registry }}/chatbot:${{ github.sha }}