-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CAI-183] Chatbot Patch query api (#1198)
* feat(chatbot): session GSI * feat(chatbot): docker compose * fix(chatbot): dynamodb and redis for local development with docker compose * chore(chatbot):remove duplicate imports * chore(chatbot): linting * fix(chatbot):create index in docker * chore(chatbot): llamaindex index id * fix(chatbot): create vector index with all docs * chore(chatbot): terraform lint * fix(chatbot): terraform syntax * chore(chatbot): remove dynamodb options * chore(chatbot): from global to local secondary index * feat(chatbot): find or create session * feat(chatbot): PATCH /sessions/{sessionId}/queries/{id} feedback API * chore(chatbot): lint * chore: remove old var * Update apps/chatbot/docker/compose.yaml Co-authored-by: marcobottaro <[email protected]> * chore: remove logs * fix(chatbot): compose vars * Update modules * Update config prompts * Update env example * redis admin port * chore: add env example var * dynamodb utility scripts for local development * page params * CHB_SESSION_MAX_DURATION_DAYS env var * chore: dynamodb local scripts * fix(chatbot): query list filter * chore(chatbot): remove query detail API * feat(chatbot): queries in ascending order --------- Co-authored-by: marcobottaro <[email protected]> Co-authored-by: mdciri <[email protected]>
- Loading branch information
1 parent
5c4aa59
commit f346179
Showing
11 changed files
with
181 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
docker compose -f docker/compose.yaml -p chatbot run create_index |
33 changes: 33 additions & 0 deletions
33
apps/chatbot/scripts/dynamodb-create-table-queries-local.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
aws dynamodb create-table \ | ||
--table-name chatbot-local-queries \ | ||
--key-schema \ | ||
AttributeName=sessionId,KeyType=HASH \ | ||
AttributeName=id,KeyType=RANGE \ | ||
--attribute-definitions \ | ||
AttributeName=id,AttributeType=S \ | ||
AttributeName=sessionId,AttributeType=S \ | ||
AttributeName=createdAt,AttributeType=S \ | ||
--local-secondary-indexes '[ | ||
{ | ||
"IndexName": "QueriesByCreatedAtIndex", | ||
"KeySchema": [ | ||
{ | ||
"AttributeName": "sessionId", | ||
"KeyType": "HASH" | ||
}, | ||
{ | ||
"AttributeName": "createdAt", | ||
"KeyType": "RANGE" | ||
} | ||
], | ||
"Projection": { | ||
"ProjectionType": "ALL" | ||
} | ||
} | ||
]' \ | ||
--table-class STANDARD \ | ||
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \ | ||
--endpoint-url http://localhost:8000 \ | ||
--region eu-south-1 \ | ||
--profile dummy |
33 changes: 33 additions & 0 deletions
33
apps/chatbot/scripts/dynamodb-create-table-sessions-local.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
aws dynamodb create-table \ | ||
--table-name chatbot-local-sessions \ | ||
--key-schema \ | ||
AttributeName=userId,KeyType=HASH \ | ||
AttributeName=id,KeyType=RANGE \ | ||
--attribute-definitions \ | ||
AttributeName=id,AttributeType=S \ | ||
AttributeName=userId,AttributeType=S \ | ||
AttributeName=createdAt,AttributeType=S \ | ||
--local-secondary-indexes '[ | ||
{ | ||
"IndexName": "SessionsByCreatedAtIndex", | ||
"KeySchema": [ | ||
{ | ||
"AttributeName": "userId", | ||
"KeyType": "HASH" | ||
}, | ||
{ | ||
"AttributeName": "createdAt", | ||
"KeyType": "RANGE" | ||
} | ||
], | ||
"Projection": { | ||
"ProjectionType": "ALL" | ||
} | ||
} | ||
]' \ | ||
--table-class STANDARD \ | ||
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \ | ||
--endpoint-url http://localhost:8000 \ | ||
--region eu-south-1 \ | ||
--profile dummy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
aws dynamodb delete-table \ | ||
--table-name chatbot-local-queries \ | ||
--endpoint-url http://localhost:8000 \ | ||
--region eu-south-1 \ | ||
--profile dummy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
aws dynamodb delete-table \ | ||
--table-name chatbot-local-sessions \ | ||
--endpoint-url http://localhost:8000 \ | ||
--region eu-south-1 \ | ||
--profile dummy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
aws dynamodb scan \ | ||
--table-name chatbot-local-queries \ | ||
--region eu-south-1 \ | ||
--endpoint-url http://localhost:8000 \ | ||
--profile dummy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
aws dynamodb scan \ | ||
--table-name chatbot-local-sessions \ | ||
--region eu-south-1 \ | ||
--endpoint-url http://localhost:8000 \ | ||
--profile dummy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters