-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add stop conversation and regeneration #545
Merged
Conversation
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
refactor: update UI and add unused check in infrastructure
feat: support china region deployment
feat: chat interruption and regeneration
chore: update user stack
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #
🤖 AI-Generated PR Description (Powered by Amazon Bedrock)
Description
This pull request introduces a new feature that integrates SageMaker models with the chatbot system. It includes the following changes:
source/infrastructure/lib/api/chatbot-management.ts
to handle chatbot management functionality.source/infrastructure/lib/api/model-management.ts
to support SageMaker model integration.source/lambda/online/common_logic/langchain_integration/models/chat_models/sagemaker_models.py
to provide an interface for interacting with SageMaker models.The motivation behind this change is to leverage the power of SageMaker's pre-trained models and fine-tuning capabilities to enhance the chatbot's performance and adaptability. This integration will allow for seamless deployment and management of SageMaker models within the chatbot system.
Type of change
File Stats Summary
File number involved in this PR: 29, unfold to see the details:
The file changes summary is as follows:
Duration
module from theaws-cdk-lib
library.noUnusedLocals
compiler option in TypeScript, which will now flag any unused local variables as errors.LayerVersion
andCode
from theaws-cdk-lib/aws-lambda
module.Aws
andStackProps
classes, and theArchitecture
class from the AWS Lambda module, while keeping the essential imports.Duration
class from theaws-cdk-lib
library.RemovalPolicy
class from the 'aws-cdk-lib' module and imports the 'dotenv' and 'aws-dynamodb' modules.chatStack
variable and only retains the declaration ofchatStackOutputs
variable.Duration
,NestedStack
,PhysicalName
), adding adeployRegion
property to theUserConstruct
, and updating theCfnOutput
to useuserConstruct.userPoolId
instead ofuserConstruct.userPool.userPoolId
.chatbotTableName
variable, adds a newstopSignalsTableName
property, removes the unusedapiLambdaJobSourceLayer
, and updates the environment variables passed to the Lambda functions to include the newSTOP_SIGNALS_TABLE_NAME
.Aws
andCustomResource
fromaws-cdk-lib
, removing the import ofs3deploy
fromaws-cdk-lib/aws-s3-deployment
, and adding a new import ofs3Deployment
fromaws-cdk-lib/aws-s3-deployment
. Additionally, it replaces thes3deploy.BucketDeployment
withs3Deployment.BucketDeployment
and modifies the deployment configuration.UiExportsConstruct
to create an AWS Custom Resource that puts a JSON configuration file (aws-exports.json
) in an S3 bucket during the onCreate and onUpdate lifecycle events, with the file content being theuiProps
passed as a prop. It also sets the necessary permissions for the Custom Resource to perform the S3 PutObject action.CloudFrontToS3
solution construct with custom CloudFront and S3 configurations, providing more control and customization options for the web portal deployment.Removed imports for unused modules
Initialized modelRegion from props
Removed unused sagemakerRole variable
Removed createKnowledgeBaseEndpointScaling method for endpoint autoscaling
Simplified initializeSageMakerConfig method |
| source/infrastructure/lib/api/model-management.ts | 7 added, 6 removed | This code change removes the import and usage of the PythonLayerVersion from the aws-lambda-python-alpha library, and adds a new resource 'endpoints' under the 'modelManagement' resource with a GET method integration to the existing lambda function. |
| source/lambda/online/common_logic/common_utils/constant.py | 11 added, 7 removed | The code changes include adding/modifying constant values for various classes like IntentType, MKTUserType, HistoryType, LLMTaskType, MessageType, ModelProvider, LLMModelType, SageMakerProvider, Threshold, and introducing a new class WSConnectionSignal with a constant "STOP". |
| source/infrastructure/lib/api/api-stack.ts | 151 added, 212 removed | This code change modifies the API Gateway setup and adds deployment delay using AWS CDK custom resources. It also refactors the API resource creation into separate constructs for better organization and maintainability. The key changes are:
Adds a custom resource to introduce a delay during deployment stages.
Separates API resource creation into separate constructs (ChatbotManagementApi, ChatHistoryApi, PromptApi, IntentionApi, ModelApi).
Restructures the API Gateway deployment and stage creation.
Removes unused imports and variables. |