Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
42266b3
Remove engine.py
mdciri Aug 8, 2025
189d19e
Add agent with its tools
mdciri Aug 8, 2025
68c6383
Add pydantic setting class
mdciri Aug 8, 2025
4486200
Update modules scripts
mdciri Aug 8, 2025
d8ce5b0
Update notebook
mdciri Aug 8, 2025
f8b83f8
Update params
mdciri Aug 8, 2025
7b6fcfc
Update poetry without bedrock classes
mdciri Aug 8, 2025
c1ad43f
Update modules scripts
mdciri Aug 8, 2025
572a643
Update settings
mdciri Aug 8, 2025
552d345
Update chatbot evaluate modules
mdciri Aug 8, 2025
c6d3f45
Add changeset
mdciri Aug 8, 2025
a148a04
Update modules
mdciri Aug 8, 2025
0810de7
Update chatbot evaluate modules
mdciri Aug 8, 2025
fa1eeb6
Update README
mdciri Aug 8, 2025
243e89d
Update chatbot evaluate scripts
mdciri Aug 8, 2025
b4ad654
Update chatbot evaluate lambda function
mdciri Aug 8, 2025
021c688
remove unused imports
batdevis Aug 8, 2025
b7dd425
Update settings
mdciri Aug 8, 2025
9ef74e6
Merge branch 'CAI-527-gemini2.5' of github.com:pagopa/developer-porta…
mdciri Aug 8, 2025
7dbfc94
Update Dockerfile
mdciri Aug 8, 2025
a4a2676
Update modules
mdciri Aug 8, 2025
53472b7
chatbon init
batdevis Aug 8, 2025
747ae4d
Merge branch 'main' into CAI-527-gemini2.5
mdciri Aug 8, 2025
c01787a
Merge branch 'main' into CAI-527-gemini2.5
mdciri Aug 8, 2025
e3ecfcd
Update chatbot modules
mdciri Aug 18, 2025
c3248b0
Update chatbot evaluation monitor.py
mdciri Aug 18, 2025
942b12a
Merge branch 'CAI-527-gemini2.5' of github.com:pagopa/developer-porta…
mdciri Aug 18, 2025
a8d68d4
Fix repetitive references
mdciri Aug 18, 2025
8bcec38
Merge branch 'main' into CAI-527-gemini2.5
uolter Aug 19, 2025
221d9eb
Update evaluator settings
mdciri Aug 19, 2025
6ab8ccb
Merge branch 'CAI-527-gemini2.5' of github.com:pagopa/developer-porta…
mdciri Aug 19, 2025
00e1c79
Update chatbot modules
mdciri Aug 19, 2025
db9f2cf
Update chatbot evaluator modules
mdciri Aug 19, 2025
8fd1373
Update chatbot evaluator modules
mdciri Aug 19, 2025
b6845a6
Update chatbot evaluator modules
mdciri Aug 19, 2025
ffd62e9
Merge branch 'main' into CAI-527-gemini2.5
mdciri Aug 20, 2025
78ea634
Update aws keys in settings
mdciri Aug 20, 2025
119b3b1
Update models id env vars in infrastructure
mdciri Aug 20, 2025
36ce953
fix import error
batdevis Aug 21, 2025
b4f2f3f
Fix odd number of code block insertion in the output string
mdciri Aug 21, 2025
8db9dd0
fix localstack docker compose
batdevis Aug 21, 2025
e900ea7
Merge branch 'CAI-527-gemini2.5' of github.com:pagopa/developer-porta…
batdevis Aug 21, 2025
c635df7
Update chatbot script
mdciri Aug 21, 2025
2be8349
Merge branch 'main' into CAI-527-gemini2.5
mdciri Aug 21, 2025
d80e07a
Remove docker volume folder
mdciri Aug 21, 2025
26038d5
Update .gitignore
mdciri Aug 21, 2025
20ff137
Merge branch 'main' into CAI-527-gemini2.5
mdciri Aug 22, 2025
31c983c
Update monitor
mdciri Aug 22, 2025
9b2d985
Merge branch 'main' into CAI-527-gemini2.5
uolter Aug 22, 2025
d139d72
Update settings
mdciri Aug 22, 2025
47715fd
Merge branch 'CAI-527-gemini2.5' of github.com:pagopa/developer-porta…
mdciri Aug 22, 2025
aef45e0
Update settings
mdciri Aug 22, 2025
14d635a
Update settings
mdciri Aug 22, 2025
91eae13
Add log on documents
mdciri Aug 22, 2025
3fd474a
Update documents.py
mdciri Aug 22, 2025
4b3b567
Update tests
mdciri Aug 22, 2025
8c2f397
Add chabot-index
mdciri Aug 26, 2025
da418f4
Update chatbot-index modules
mdciri Aug 27, 2025
2f5d66a
Update settings
mdciri Aug 27, 2025
0a2eeb0
Add params
mdciri Aug 27, 2025
57e9d1f
Update chatbot-index modules
mdciri Aug 27, 2025
3d27bf2
Add poetry lock
mdciri Aug 27, 2025
5b131d6
Update chatbot-index lambda
mdciri Aug 27, 2025
b2d4112
Update chatbot-index lambda function
mdciri Aug 27, 2025
2416596
Add chatbot-index tests
mdciri Aug 27, 2025
f766e2d
Update lambda
mdciri Aug 27, 2025
a39a1b0
Add changeset
mdciri Aug 29, 2025
da23f07
Merge branch 'main' into CAI-470-t2-add-update-delete-functions
mdciri Aug 29, 2025
91c4f33
[CAI-565] add versioning to chatbot-index (#1648)
MarBert Sep 1, 2025
2b28567
Merge branch 'main' into CAI-470-t2-add-update-delete-functions
batdevis Sep 12, 2025
760aaeb
Merge branch 'main' into CAI-470-t2-add-update-delete-functions
mdciri Sep 15, 2025
559e4d6
Update react agent prompt
mdciri Sep 17, 2025
42a0ac3
Update max tokens in settings
mdciri Sep 17, 2025
88c3c52
Update agent temperature in settings
mdciri Sep 17, 2025
965a28d
Update max tokens env var in infrastructure
mdciri Sep 17, 2025
6075288
Update params
mdciri Sep 24, 2025
5f8345c
Merge branch 'main' into CAI-470-t2-add-update-delete-functions
mdciri Sep 24, 2025
0f69d8c
Update module in chatbot-index
mdciri Sep 24, 2025
ecf285a
Add docker folder
mdciri Sep 24, 2025
68c7080
Add example .env
mdciri Sep 24, 2025
9b2d358
Update gitignore
mdciri Sep 24, 2025
c8c3971
Update chatbot docker compose
mdciri Sep 24, 2025
3ccec81
Update gitignore
mdciri Sep 24, 2025
5f6eb87
Update chatbot docker compose
mdciri Sep 24, 2025
ac1300f
Update chatbot-index lambda function
mdciri Sep 24, 2025
5fee551
Update docker compase up index script
mdciri Sep 24, 2025
2fe94b6
Update docker compase up index script
mdciri Sep 24, 2025
3be6b51
Update chatbot-index settings
mdciri Sep 24, 2025
5ce7e8d
Add invoke chatbot-index lambda
mdciri Sep 24, 2025
eb03bc0
Update docker compose
mdciri Sep 24, 2025
e740900
Update chatbot-index params
mdciri Sep 24, 2025
9a60314
Update chatbot-index modules
mdciri Sep 24, 2025
d3e29e7
Add create index lambda function in chatbot-index
mdciri Sep 24, 2025
0829a74
Rename lambda function
mdciri Sep 24, 2025
ba566f5
Update scripts to invoke index lambda functions
mdciri Sep 24, 2025
660b03c
Update chatbot docker compose
mdciri Sep 24, 2025
a9b6c91
Update involke create index lambda function
mdciri Sep 24, 2025
952b1f3
Update docker compose and index-up script
mdciri Sep 24, 2025
0c97dd6
Update invoke create index script
mdciri Sep 24, 2025
d876ae4
Update lambda create index in chatbot-index
mdciri Sep 24, 2025
7fd3f77
lambda timeout AWS_LAMBDA_FUNCTION_TIMEOUT=900
batdevis Sep 24, 2025
672f6cc
avoid crash on chromedriver error
batdevis Sep 24, 2025
c5521ff
chromedriver
batdevis Sep 24, 2025
7341a02
Update embedder input arguments
mdciri Sep 25, 2025
e2bebb0
Merge branch 'main' into CAI-470-t2-add-update-delete-functions
uolter Sep 25, 2025
058cfc3
Update chatbot-index modules
mdciri Sep 25, 2025
c8b32bb
Update chatbot-index .env example
mdciri Sep 25, 2025
f1b1a63
Merge branch 'CAI-470-t2-add-update-delete-functions' of github.com:p…
mdciri Sep 25, 2025
64ae9b9
Remove documents.py and create_index.py from chatbot
mdciri Sep 25, 2025
2f9ef75
Update chatbot modules
mdciri Sep 25, 2025
642c19a
Update chatbot params
mdciri Sep 25, 2025
fd3ac6f
Removed utils.py
mdciri Sep 25, 2025
95ee796
Update settings
mdciri Sep 25, 2025
c977d3f
Update chatbot-index modules
mdciri Sep 25, 2025
fcdb0f3
Update chatbot-index params
mdciri Sep 25, 2025
6af37ff
Update chatbot modules
mdciri Sep 25, 2025
a8623c2
Update chatbot params
mdciri Sep 25, 2025
ee23bb4
Update chatbot settings
mdciri Sep 25, 2025
550b0f1
Update chatbot-index settings
mdciri Sep 25, 2025
d5ab670
remove selenium from chatbot
batdevis Sep 25, 2025
7f2ac5a
2 lambda dockerfiles
batdevis Sep 25, 2025
b941425
dockerfile name
batdevis Sep 25, 2025
7e263a2
update docker file in deploy chatbot index pipeline
uolter Sep 25, 2025
05c8025
Update chatbot settings
mdciri Sep 25, 2025
23eddd2
Update chatbot-index settings
mdciri Sep 25, 2025
74698e2
Merge branch 'CAI-470-t2-add-update-delete-functions' of github.com:p…
mdciri Sep 25, 2025
51a581f
fix dynamo declarations for local development
batdevis Sep 26, 2025
61dde06
local emulations cfg
batdevis Sep 26, 2025
1bc34cf
do not use env vars for aws client auth
batdevis Sep 30, 2025
e9d4cd4
log
batdevis Sep 30, 2025
02a293c
fix event decode
batdevis Sep 30, 2025
1aad92c
boto s3 client env vars
batdevis Sep 30, 2025
80a526b
boto s3 client env vars
batdevis Sep 30, 2025
679b5b3
do not pass any params to boto3 client
batdevis Sep 30, 2025
8d46813
logs
batdevis Sep 30, 2025
4077dd7
fix key not found
batdevis Sep 30, 2025
a99ba0f
Update lambda function
mdciri Sep 30, 2025
f0115ea
Update chatbot-index lambda function
mdciri Oct 1, 2025
62715aa
Merge branch 'main' of https://github.com/pagopa/developer-portal int…
uolter Oct 1, 2025
0eb8952
Add logs to chatbot-index vector_index.py
mdciri Oct 1, 2025
d295811
Merge branch 'CAI-470-t2-add-update-delete-functions' of github.com:p…
mdciri Oct 1, 2025
297245a
update docker file in action deploy chatbot reindex
uolter Oct 1, 2025
dcf5880
Merge branch 'CAI-470-t2-add-update-delete-functions' of https://gith…
uolter Oct 1, 2025
646b709
Updated chatbot-index documents with a log
mdciri Oct 1, 2025
6cbfb21
Merge branch 'CAI-470-t2-add-update-delete-functions' of github.com:p…
mdciri Oct 1, 2025
6c4eaf6
Updated chatbot-index documents
mdciri Oct 1, 2025
4eef1f2
Updated chatbot-index documents
mdciri Oct 1, 2025
6e12e72
Updated chatbot-index documents
mdciri Oct 1, 2025
a347f06
Updated chatbot-index documents
mdciri Oct 1, 2025
039aee5
Merge branch 'main' of https://github.com/pagopa/developer-portal int…
uolter Oct 2, 2025
ce17786
first test with opentelemetry
uolter Oct 2, 2025
d0498d2
update docker image
uolter Oct 2, 2025
142101c
fix missed parameter in copy command
uolter Oct 2, 2025
947a127
update open telemetry configuration
uolter Oct 2, 2025
e3bdec1
try to instument the code
uolter Oct 2, 2025
e5a962b
fix wrong import
uolter Oct 2, 2025
8a4f820
update doker image with open telemetry
uolter Oct 2, 2025
2c6a80e
update docker file
uolter Oct 2, 2025
6bd8a14
update openteletry condif rollback docker file
uolter Oct 2, 2025
50bc65f
update open telemetry config
uolter Oct 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cruel-rocks-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chatbot": patch
---

Code refactor with new gemini models
5 changes: 5 additions & 0 deletions .changeset/rich-pears-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chatbot-index": patch
---

Add package.json to the chatbot-index app to allow versioning
5 changes: 5 additions & 0 deletions .changeset/wild-hoops-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chatbot": minor
---

Add function to add, update, and remove documents and the relative nodes from the vector index.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_lambda_chatbot_index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
IMAGE_TAG: ${{ github.sha }}
with:
context: apps/chatbot-index
file: apps/chatbot-index/docker/lambda.Dockerfile
file: apps/chatbot-index/docker/lambda_refresh_index.Dockerfile
push: true
tags: ${{ env.ECR_REGISTRY }}/chatbot-index:${{ env.IMAGE_TAG }}
provenance: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_lambda_chatbot_reindex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
IMAGE_TAG: ${{ github.sha }}
with:
context: apps/chatbot-index
file: apps/chatbot-index/docker/lambda_refresh_index.Dockerfile
file: apps/chatbot-index/docker/lambda_create_index.Dockerfile
push: true
tags: ${{ env.ECR_REGISTRY }}/chatbot-reindex:${{ env.IMAGE_TAG }}
provenance: false
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ apps/chatbot/index
apps/chatbot/*.ipynb
apps/chatbot/results
apps/chatbot/test.py
app/chabot/docker/volume
!apps/chatbot/docker
apps/chatbot/docker/volume
apps/chatbot/.env
apps/chatbot/empty_htmls.json
apps/chatbot/.google_service_account.json
Expand All @@ -413,6 +414,13 @@ apps/chatbot-evaluate/*.ipynb
apps/chatbot-evaluate/.env
apps/chatbot-evaluate/.google_service_account.json

# chatbot-index
apps/chatbot-index/*.ipynb
!apps/chatbot-index/docker
apps/chatbot-index/.env
!apps/chatbot-index/.env.example
apps/chatbot-index/.google_service_account.json

/results

# terraform
Expand Down
21 changes: 21 additions & 0 deletions apps/chatbot-index/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
AWS_ENDPOINT_URL=http://localstack:4566
AWS_ACCESS_KEY_ID=dummy
AWS_DEFAULT_REGION=eu-south-1
AWS_SECRET_ACCESS_KEY=dummy
AWS_LAMBDA_FUNCTION_TIMEOUT=900
CHB_AWS_GOOGLE_API_KEY=...
CHB_AWS_S3_BUCKET_NAME_STATIC_CONTENT=devportal-d-website-static-content
CHB_REDIS_URL=redis://redis:6379
CHB_WEBSITE_URL=https://dev.developer.pagopa.it
LOG_LEVEL=DEBUG
PYTHONPATH=/app

CHB_EMBED_BATCH_SIZE=100
CHB_EMBEDDING_DIM=768
CHB_EMBED_MODEL_ID=gemini-embedding-001
CHB_EMBED_RETRIES=30
CHB_EMBED_RETRY_MIN_SECONDS=1.5
CHB_MODEL_MAXTOKENS=2048
CHB_MODEL_ID=gemini-2.5-flash-lite
CHB_MODEL_TEMPERATURE=0.3
CHB_PROVIDER=google
17 changes: 17 additions & 0 deletions apps/chatbot-index/config/adot-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
receivers:
telemetryapi:
otlp:
protocols:
grpc:
http:

exporters:
logging:
loglevel: debug
awsxray:

service:
pipelines:
traces:
receivers: [otlp]
exporters: [logging, awsxray]
4 changes: 4 additions & 0 deletions apps/chatbot-index/config/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vector_index:
index_id: discovery-index
chunk_size: 1024
chunk_overlap: 200
39 changes: 39 additions & 0 deletions apps/chatbot-index/docker/lambda_create_index.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM public.ecr.aws/lambda/python:3.12
ARG DEBIAN_FRONTEND=noninteractive

ENV PYTHONPATH=$LAMBDA_TASK_ROOT

RUN dnf install -y wget unzip jq shadow-utils \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub -o /etc/pki/rpm-gpg/RPM-GPG-KEY-google \
&& echo '[google-chrome]' > /etc/yum.repos.d/google-chrome.repo \
&& echo 'name=google-chrome - x86_64' >> /etc/yum.repos.d/google-chrome.repo \
&& echo 'baseurl=https://dl.google.com/linux/chrome/rpm/stable/x86_64' >> /etc/yum.repos.d/google-chrome.repo \
&& echo 'enabled=1' >> /etc/yum.repos.d/google-chrome.repo \
&& echo 'gpgcheck=1' >> /etc/yum.repos.d/google-chrome.repo \
&& echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-google' >> /etc/yum.repos.d/google-chrome.repo \
&& dnf install -y google-chrome-stable \
\
# Install chromedriver using Chrome for Testing API
&& DRIVER_VERSION=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json \
| jq -r ".channels.Stable.version") \
&& wget -q "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${DRIVER_VERSION}/linux64/chromedriver-linux64.zip" \
&& unzip chromedriver-linux64.zip -d /usr/bin/ \
&& mv /usr/bin/chromedriver-linux64/chromedriver /usr/bin/chromedriver \
&& rm -rf chromedriver-linux64.zip /usr/bin/chromedriver-linux64 \
\
&& dnf clean all

RUN pip install --upgrade pip \
&& pip install poetry

WORKDIR $LAMBDA_TASK_ROOT
COPY pyproject.toml $LAMBDA_TASK_ROOT
COPY poetry.lock $LAMBDA_TASK_ROOT
COPY --from=039804388894.dkr.ecr.eu-south-1.amazonaws.com/lambda-extension/otel-collector:v1 /src/collector /opt/extensions/collector
COPY config/adot-config.yaml /opt/collector-config/config.yaml
RUN poetry config virtualenvs.create false
RUN poetry install

COPY ./ ${LAMBDA_TASK_ROOT}/

CMD ["src.lambda_create_index.lambda_handler"]
39 changes: 39 additions & 0 deletions apps/chatbot-index/docker/lambda_refresh_index.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM public.ecr.aws/lambda/python:3.12
ARG DEBIAN_FRONTEND=noninteractive

ENV PYTHONPATH=$LAMBDA_TASK_ROOT

RUN dnf install -y wget unzip jq shadow-utils \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub -o /etc/pki/rpm-gpg/RPM-GPG-KEY-google \
&& echo '[google-chrome]' > /etc/yum.repos.d/google-chrome.repo \
&& echo 'name=google-chrome - x86_64' >> /etc/yum.repos.d/google-chrome.repo \
&& echo 'baseurl=https://dl.google.com/linux/chrome/rpm/stable/x86_64' >> /etc/yum.repos.d/google-chrome.repo \
&& echo 'enabled=1' >> /etc/yum.repos.d/google-chrome.repo \
&& echo 'gpgcheck=1' >> /etc/yum.repos.d/google-chrome.repo \
&& echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-google' >> /etc/yum.repos.d/google-chrome.repo \
&& dnf install -y google-chrome-stable \
\
# Install chromedriver using Chrome for Testing API
&& DRIVER_VERSION=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json \
| jq -r ".channels.Stable.version") \
&& wget -q "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${DRIVER_VERSION}/linux64/chromedriver-linux64.zip" \
&& unzip chromedriver-linux64.zip -d /usr/bin/ \
&& mv /usr/bin/chromedriver-linux64/chromedriver /usr/bin/chromedriver \
&& rm -rf chromedriver-linux64.zip /usr/bin/chromedriver-linux64 \
\
&& dnf clean all

RUN pip install --upgrade pip \
&& pip install poetry

WORKDIR $LAMBDA_TASK_ROOT
COPY pyproject.toml $LAMBDA_TASK_ROOT
COPY poetry.lock $LAMBDA_TASK_ROOT
COPY --from=039804388894.dkr.ecr.eu-south-1.amazonaws.com/lambda-extension/otel-collector:v1 /src/collector /opt/extensions/collector
COPY config/adot-config.yaml /opt/collector-config/config.yaml
RUN poetry config virtualenvs.create false
RUN poetry install

COPY ./ ${LAMBDA_TASK_ROOT}/

CMD ["src.lambda_refresh_index.lambda_handler"]
6 changes: 6 additions & 0 deletions apps/chatbot-index/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "chatbot-index",
"version": "1.0.0",
"private": true,
"scripts": {}
}
Loading
Loading