Skip to content

Commit 34a0369

Browse files
author
Kyle Lilly
committed
Precommit fixes based on license header addition and CDK tests which hadn't been run through pre-commit previously.
1 parent b196aa3 commit 34a0369

File tree

112 files changed

+1919
-910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1919
-910
lines changed

.eslintrc.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"env": {
3+
"node": true
4+
},
5+
"parser": "@typescript-eslint/parser",
6+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
7+
"parserOptions": {
8+
"ecmaVersion": 2020,
9+
"sourceType": "module"
10+
},
11+
"plugins": ["@typescript-eslint", "import"],
12+
"rules": {
13+
"max-len": [
14+
"error",
15+
{
16+
"code": 120,
17+
"ignoreComments": false,
18+
"ignoreStrings": false,
19+
"ignoreTemplateLiterals": false,
20+
"ignoreRegExpLiterals": false,
21+
"ignoreUrls": false
22+
}
23+
],
24+
"@typescript-eslint/no-explicit-any": "warn",
25+
"import/order": [
26+
"error",
27+
{
28+
"newlines-between": "always",
29+
"groups": ["builtin", "external", "internal", ["parent", "sibling", "index"]],
30+
"alphabetize": {
31+
"order": "asc",
32+
"caseInsensitive": true
33+
}
34+
}
35+
]
36+
}
37+
}

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"useTabs": false,
6+
"tabWidth": 2,
7+
"semi": true
8+
}

CHANGELOG.md

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
11
## March 26, 2024
22

33
#### Breaking changes
4+
45
- [V1282850793] Shorten logical and physical CDK resource names
5-
- Long resource names were causing collisions when they were getting truncated. This was particularly problematic for customers using the Enterprise CDK `PermissionsBoundaryAspect`.
6-
- By updating these resource names and naming conventions you will not be able to simply redploy the latest changes on top of your existing deployment.
6+
- Long resource names were causing collisions when they were getting truncated. This was particularly problematic for customers using the Enterprise CDK `PermissionsBoundaryAspect`.
7+
- By updating these resource names and naming conventions you will not be able to simply redploy the latest changes on top of your existing deployment.
78
- [V1282892036] Combine Session, Chat, and RAG API Gateways into a single API Gateway
8-
- While Session, Chat, and RAG all remain completely optional, deploying any combination of them will result in a single API Gateway (with configurable custom domain)
9-
9+
- While Session, Chat, and RAG all remain completely optional, deploying any combination of them will result in a single API Gateway (with configurable custom domain)
1010

1111
#### Enhancements
12+
1213
- [V1282843657] Add support for PGVector VectorStore
13-
- Customers can now configure LISA to use PGVector in addition or in place of OpenSearch for their RAG repository. LISA can connect to an existing RDS Postgres instance or one can be deployed as part of the LISA deployment.
14-
- PGVector is now the "default" configuration in the `config.yaml` file as PGVector is considerably faster to deploy for demo/test purposes
14+
- Customers can now configure LISA to use PGVector in addition or in place of OpenSearch for their RAG repository. LISA can connect to an existing RDS Postgres instance or one can be deployed as part of the LISA deployment.
15+
- PGVector is now the "default" configuration in the `config.yaml` file as PGVector is considerably faster to deploy for demo/test purposes
1516
- [V1282894257] Improved support for custom DNS
16-
- Customers can now specify a custom domain name for the LISA API Gateway as well as the LISA Serve REST ALB. If these values are set in the `config.yaml` file the UI will automatically use the correct pathing when making service requests without needing any additional code changes.
17+
- Customers can now specify a custom domain name for the LISA API Gateway as well as the LISA Serve REST ALB. If these values are set in the `config.yaml` file the UI will automatically use the correct pathing when making service requests without needing any additional code changes.
1718
- [V1282858379] Move advanced chat configuration options between a collapsible "Advanced configuration" sectoin
18-
- The chat "control panel" has been redesigned to hide the following items chat buffer, model kwargs, prompt template, and the metadata toggle
19+
- The chat "control panel" has been redesigned to hide the following items chat buffer, model kwargs, prompt template, and the metadata toggle
1920
- [V1282855530] Add support for Enterprise CDK PermissionBoundaryAspect and custom synthesizer
20-
- Added new property to the `config.yaml` to allow customers to optionally specify a configuration for the PermissionBoundaryAspect. If counfigured the aspect will be applied to all stacks
21-
- Added new property to the `config.yaml` to allow customers to optionally specify a stack sythensizer for the deployment. If counfigured the specified synthesizer will be set as a property on all stacks
21+
- Added new property to the `config.yaml` to allow customers to optionally specify a configuration for the PermissionBoundaryAspect. If counfigured the aspect will be applied to all stacks
22+
- Added new property to the `config.yaml` to allow customers to optionally specify a stack sythensizer for the deployment. If counfigured the specified synthesizer will be set as a property on all stacks
2223
- [V1282860639] Add support for configuring a system banner
23-
- Customers can customize the foreground, background, and text content via `config.yaml`
24+
- Customers can customize the foreground, background, and text content via `config.yaml`
2425
- [V1282834825] Support for bringing an existing VPC
25-
- Customers can optionally specify a VPC ID in `config.yaml`. If set LISA will import the corresponding VPC instead of creating a new one.
26+
- Customers can optionally specify a VPC ID in `config.yaml`. If set LISA will import the corresponding VPC instead of creating a new one.
2627
- [V1282880371] Support for additional (smaller) instance types for use with the LISA Serve REST API
27-
- Default is now an `m5.large` however customers can use any instance type they wish although they may need to update `schema.ts` if the instance type isn't already listed there
28+
- Default is now an `m5.large` however customers can use any instance type they wish although they may need to update `schema.ts` if the instance type isn't already listed there
2829

2930
#### Bugs
31+
3032
- [AIML-ADC-7604] Rag context not visible in metadata until subsequent messages
31-
- This has been addressed by adding a dedicated `ragContext` property to the message metadata. The relevant documents including s3 key will now be visible when sending a message with a RAG repository and embedding model selected.
33+
- This has been addressed by adding a dedicated `ragContext` property to the message metadata. The relevant documents including s3 key will now be visible when sending a message with a RAG repository and embedding model selected.
3234
- [V1283663967] Chat messages occasionally wrap
33-
- Sometimes the model returns text that gets wrapped in ``<pre><code> </code></pre>``. The default style for this content now has word-wrap and word-break styles applied to prevent the message overflowing.
35+
- Sometimes the model returns text that gets wrapped in `<pre><code> </code></pre>`. The default style for this content now has word-wrap and word-break styles applied to prevent the message overflowing.
3436

3537
#### Additional changes
38+
3639
- Resolved issue with files being added to the selected files list twice during RAG ingest.
3740
- Added flashbar notification and automatically close RAG modal after successful upload
3841
- Customers can optionally specify an existing OpenSearch cluster to use rather than creating one. When specifying an existing cluster customers will need to ensure the clsuter is reachable from the VPCs in which the RAG lambdas are running.

CODE_OF_CONDUCT.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## Code of Conduct
2+
23
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
34
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
45
[email protected] with any additional questions or comments.

CONTRIBUTING.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,23 @@ documentation, we greatly value feedback and contributions from our community.
66
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
77
information to effectively respond to your bug report or contribution.
88

9-
109
## Reporting Bugs/Feature Requests
1110

1211
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1312

1413
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
1514
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1615

17-
* A reproducible test case or series of steps
18-
* The version of our code being used
19-
* Any modifications you've made relevant to the bug
20-
* Anything unusual about your environment or deployment
21-
16+
- A reproducible test case or series of steps
17+
- The version of our code being used
18+
- Any modifications you've made relevant to the bug
19+
- Anything unusual about your environment or deployment
2220

2321
## Contributing via Pull Requests
22+
2423
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2524

26-
1. You are working against the latest source on the *main* branch.
25+
1. You are working against the latest source on the _main_ branch.
2726
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
2827
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
2928

@@ -39,20 +38,19 @@ To send us a pull request, please:
3938
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4039
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4140

42-
4341
## Finding contributions to work on
44-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
4542

43+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
4644

4745
## Code of Conduct
46+
4847
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
4948
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
5049
[email protected] with any additional questions or comments.
5150

52-
5351
## Security issue notifications
54-
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5552

53+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5654

5755
## Licensing
5856

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ gunicorn -k uvicorn.workers.UvicornWorker -w 2 -b "0.0.0.0:8080" "src.main:app"
324324
```
325325

326326
### Run example chatbot locally
327+
327328
Create `lib/user-interface/react/public/env.js` file with the following contents:
329+
328330
```
329331
window.env = {
330332
AUTHORITY: '<Your IdP URL here>',
@@ -335,7 +337,9 @@ window.env = {
335337
SESSION_REST_API_URI: '<API GW session endpoint>'
336338
}
337339
```
340+
338341
Launch the Chat UI:
342+
339343
```
340344
cd lib/user-interface/react/
341345
npm run dev

bin/lisa.ts

+16-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
#!/usr/bin/env node
22

3-
/*
4-
Copyright (C) 2023 Amazon Web Services, Inc. or its affiliates. All Rights Reserved.
5-
This AWS Content is provided subject to the terms of the AWS Customer Agreement
6-
available at http://aws.amazon.com/agreement or other written agreement between
7-
Customer and either Amazon Web Services, Inc. or Amazon Web Services EMEA SARL or both.
3+
/**
4+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License").
7+
You may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
817
*/
918

1019
// Main app
@@ -16,12 +25,12 @@ import { Aspects } from 'aws-cdk-lib';
1625
import { AwsSolutionsChecks } from 'cdk-nag';
1726
import * as yaml from 'js-yaml';
1827

19-
import { Config, ConfigSchema } from '../lib/schema';
28+
import { Config, ConfigFile, ConfigSchema } from '../lib/schema';
2029
import { LisaServeApplicationStage } from '../lib/stages';
2130

2231
// Read configuration file
2332
const configFilePath = path.join(__dirname, '../config.yaml');
24-
const configFile = yaml.load(fs.readFileSync(configFilePath, 'utf8')) as any;
33+
const configFile = yaml.load(fs.readFileSync(configFilePath, 'utf8')) as ConfigFile;
2534
let configEnv = configFile.env || 'dev';
2635

2736
// Select configuration environment

copyright.txt

-4
This file was deleted.

lambda/authorizer/__init__.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License").
4+
# You may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

lambda/authorizer/lambda_functions.py

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
"""
2-
Authorize for REST API.
3-
4-
Copyright (C) 2023 Amazon Web Services, Inc. or its affiliates. All Rights Reserved.
5-
This AWS Content is provided subject to the terms of the AWS Customer Agreement
6-
available at http://aws.amazon.com/agreement or other written agreement between
7-
Customer and either Amazon Web Services, Inc. or Amazon Web Services EMEA SARL or both.
8-
"""
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License").
4+
# You may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Authorize for REST API."""
916
import logging
1017
import os
1118
import ssl

lambda/repository/__init__.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License").
4+
# You may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

lambda/repository/lambda_functions.py

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
"""
2-
Lambda functions for RAG repository API.
3-
4-
Copyright (C) 2023 Amazon Web Services, Inc. or its affiliates. All Rights Reserved.
5-
This AWS Content is provided subject to the terms of the AWS Customer Agreement
6-
available at http://aws.amazon.com/agreement or other written agreement between
7-
Customer and either Amazon Web Services, Inc. or Amazon Web Services EMEA SARL or both.
8-
"""
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License").
4+
# You may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Lambda functions for RAG repository API."""
916
import json
1017
import logging
1118
import os

lambda/session/__init__.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License").
4+
# You may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

lambda/session/lambda_functions.py

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
"""
2-
Lambda functions for managing sessions.
3-
4-
Copyright (C) 2023 Amazon Web Services, Inc. or its affiliates. All Rights Reserved.
5-
This AWS Content is provided subject to the terms of the AWS Customer Agreement
6-
available at http://aws.amazon.com/agreement or other written agreement between
7-
Customer and either Amazon Web Services, Inc. or Amazon Web Services EMEA SARL or both.
8-
"""
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License").
4+
# You may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Lambda functions for managing sessions."""
916
import json
1017
import logging
1118
import os

lambda/utilities/__init__.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License").
4+
# You may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

0 commit comments

Comments
 (0)