-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Use a Bedrock Knowledge Base as RAG source (Backend) (#428)
* wip * refactor: apply sfn to invoke ecs task * wip * wip * fix * fix fe * fix poetry timoeut * fix * s3 validation * lint * omit instruction from kb * lint
- Loading branch information
Showing
46 changed files
with
3,348 additions
and
1,351 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
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
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,35 @@ | ||
from app.routes.schemas.bot_kb import ( | ||
type_kb_chunking_strategy, | ||
type_kb_embeddings_model, | ||
type_kb_search_type, | ||
type_os_character_filter, | ||
type_os_token_filter, | ||
type_os_tokenizer, | ||
) | ||
from pydantic import BaseModel | ||
|
||
|
||
class SearchParamsModel(BaseModel): | ||
max_results: int | ||
search_type: type_kb_search_type | ||
|
||
|
||
class AnalyzerParamsModel(BaseModel): | ||
character_filters: list[type_os_character_filter] | ||
tokenizer: type_os_tokenizer | ||
token_filters: list[type_os_token_filter] | ||
|
||
|
||
class OpenSearchParamsModel(BaseModel): | ||
analyzer: AnalyzerParamsModel | None | ||
|
||
|
||
class BedrockKnowledgeBaseModel(BaseModel): | ||
embeddings_model: type_kb_embeddings_model | ||
open_search: OpenSearchParamsModel | ||
chunking_strategy: type_kb_chunking_strategy | ||
search_params: SearchParamsModel | ||
max_tokens: int | None = None | ||
overlap_percentage: int | None = None | ||
knowledge_base_id: str | None = None | ||
data_source_ids: list[str] | None = None |
Oops, something went wrong.