Skip to content
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

chore: refactor and fix prompt issue #495

Merged
merged 7 commits into from
Dec 26, 2024
Merged

chore: refactor and fix prompt issue #495

merged 7 commits into from
Dec 26, 2024

Conversation

NingLu
Copy link
Collaborator

@NingLu NingLu commented Dec 25, 2024

Fixes #

🤖 AI-Generated PR Description (Powered by Amazon Bedrock)

Description

This pull request involves several changes to the project's codebase. The primary modifications include:

  • Updates to the infrastructure code for the API, chat, and model components, as well as changes to the lambda layers.
  • Removal of the aos (Automatic Object Segmentation) and embedding lambda functions, along with their associated utility files and requirements.
  • Addition of a new requirements file for the intention lambda function.
  • Modification to the langchain_utils.py file in the online/common_logic directory.
  • Removal of several files related to LangChain integration, including the hyde_chain.py, intention_chain.py, and the marketing_chains directory.

The motivation behind these changes is to streamline the codebase and remove unnecessary or deprecated functionality. The removal of the aos and embedding lambda functions, along with their associated files, suggests a shift in the project's architecture or a decision to handle these tasks differently.

Additionally, the updates to the infrastructure code and the addition of the intention lambda function's requirements file indicate potential enhancements or refactoring efforts related to the project's infrastructure and lambda functions.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

File Stats Summary

File number involved in this PR: 29, unfold to see the details:

The file changes summary is as follows:

Files
Changes
Change Summary
source/lambda/aos/main.py 0 added, 94 removed This file is removed in this PR
source/lambda/aos/utils/aos_utils.py 0 added, 611 removed This file is removed in this PR
source/lambda/aos/utils/sm_utils.py 0 added, 94 removed This file is removed in this PR
source/lambda/embedding/main.py 0 added, 155 removed This file is removed in this PR
source/lambda/embedding/requirements.txt 0 added, 13 removed This file is removed in this PR
source/lambda/embedding/utils/auto.py 0 added, 39 removed This file is removed in this PR
source/lambda/embedding/utils/cleaning.py 0 added, 229 removed This file is removed in this PR
source/lambda/embedding/utils/constant.py 0 added, 12 removed This file is removed in this PR
source/lambda/embedding/utils/csvx.py 0 added, 179 removed This file is removed in this PR
source/lambda/embedding/utils/docx.py 0 added, 97 removed This file is removed in this PR
source/lambda/embedding/utils/htmlx.py 0 added, 81 removed This file is removed in this PR
source/lambda/embedding/utils/image.py 0 added, 3 removed This file is removed in this PR
source/lambda/embedding/utils/json.py 0 added, 77 removed This file is removed in this PR
source/lambda/embedding/utils/jsonl.py 0 added, 81 removed This file is removed in this PR
source/lambda/embedding/utils/markdown.py 0 added, 51 removed This file is removed in this PR
source/lambda/embedding/utils/nougat_pdf.py 0 added, 170 removed This file is removed in this PR
source/lambda/embedding/utils/pdf.py 0 added, 163 removed This file is removed in this PR
source/lambda/embedding/utils/splitter_utils.py 0 added, 362 removed This file is removed in this PR
source/lambda/embedding/utils/storage_utils.py 0 added, 85 removed This file is removed in this PR
source/lambda/embedding/utils/text.py 0 added, 62 removed This file is removed in this PR
source/lambda/online/common_logic/langchain_integration/chains/hyde_chain.py 0 added, 107 removed This file is removed in this PR
source/lambda/online/common_logic/langchain_integration/chains/intention_chain.py 0 added, 226 removed This file is removed in this PR
source/lambda/online/common_logic/langchain_integration/chains/marketing_chains/init.py 0 added, 15 removed This file is removed in this PR
source/infrastructure/lib/model/model-construct.ts 3 added, 3 removed The code changes update the Python runtime version from 3.11 to 3.12 for three Lambda functions: ModelTriggerLambda, PipelineMonitorLambda, and ETLCustomResource.
source/lambda/intention/requirements.txt 1 added, 0 removed This code change adds the openpyxl library version 3.1.3 as a dependency to the project.
source/infrastructure/lib/chat/chat-stack.ts 5 added, 5 removed The code changes involve modifying the way the Lambda function code is copied to a temporary directory, and updating the IAM policy statement for CloudFormation actions to include missing permissions.
source/infrastructure/lib/shared/lambda-layers.ts 15 added, 36 removed The code changes involve refactoring and renaming of Lambda layer creation methods in the LambdaLayers class. The createEmbeddingLayer method is removed, and the other methods are renamed with more descriptive names, such as createOnlineSourceLayer, createJobSourceLayer, and createAuthorizerLayer.
source/infrastructure/lib/api/api-stack.ts 18 added, 77 removed This code change imports additional modules (PythonFunction, BundlingFileAccess) from AWS CDK libraries, removes some Lambda function definitions related to embedding and AOS (Automated Online Scoring), modifies the way some Lambda functions are defined (using PythonFunction instead of LambdaFunction for IntentionLambda), and adjusts the Lambda function configurations (code paths, environment variables, layers, IAM policies).
source/lambda/online/common_logic/common_utils/langchain_utils.py 0 added, 31 removed The code changes involve removing the import of the PrettyTable module and the format_trace_infos function, which was responsible for formatting and displaying trace information using PrettyTable or a simple string format.

Copy link
Contributor

@IcyKallen IcyKallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IcyKallen IcyKallen merged commit 569a000 into dev Dec 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants