├── .eslintrc.json ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yml │ ├── config.yml │ ├── documentation.yml │ └── feature-request.yml ├── actions │ └── setup │ │ └── action.yml ├── pull_request_template.md └── workflows │ ├── build.yml │ ├── pull-request-lint.yml │ ├── release.yml │ ├── stale.yml │ └── upgrade-mainline.yml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── .ncurc.json ├── .npmrc ├── .nxignore ├── .prettierignore ├── .prettierrc.json ├── .projen ├── deps.json ├── files.json └── tasks.json ├── .projenrc.ts ├── .syncpackrc.json ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── HEADER ├── LICENSE ├── LICENSE-THIRD-PARTY ├── NOTICE ├── README.md ├── approved-licenses.yaml ├── demo ├── .gitignore ├── README.md ├── api │ ├── .gitignore │ ├── .projen │ │ ├── files.json │ │ └── tasks.json │ ├── LICENSE │ ├── README.md │ ├── generated │ │ ├── documentation │ │ │ ├── README.md │ │ │ └── html2 │ │ │ │ ├── .gitignore │ │ │ │ ├── .openapi-generator-ignore │ │ │ │ ├── .pdk │ │ │ │ └── dynamic-files │ │ │ │ │ └── openapitools.json │ │ │ │ ├── .projen │ │ │ │ ├── files.json │ │ │ │ └── tasks.json │ │ │ │ ├── LICENSE │ │ │ │ ├── openapitools.json │ │ │ │ └── project.json │ │ ├── infrastructure │ │ │ ├── README.md │ │ │ └── typescript │ │ │ │ ├── .gitattributes │ │ │ │ ├── .gitignore │ │ │ │ ├── .npmignore │ │ │ │ ├── .openapi-generator-ignore │ │ │ │ ├── .openapi-generator-ignore-handlebars │ │ │ │ ├── .pdk │ │ │ │ └── dynamic-files │ │ │ │ │ └── openapitools.json │ │ │ │ ├── .projen │ │ │ │ ├── deps.json │ │ │ │ ├── files.json │ │ │ │ └── tasks.json │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── openapitools.json │ │ │ │ ├── package.json │ │ │ │ ├── project.json │ │ │ │ ├── tsconfig.dev.json │ │ │ │ └── tsconfig.json │ │ ├── libraries │ │ │ ├── README.md │ │ │ └── typescript-react-query-hooks │ │ │ │ ├── .gitattributes │ │ │ │ ├── .gitignore │ │ │ │ ├── .openapi-generator-ignore │ │ │ │ ├── .openapi-generator-ignore-handlebars │ │ │ │ ├── .pdk │ │ │ │ └── dynamic-files │ │ │ │ │ └── openapitools.json │ │ │ │ ├── .projen │ │ │ │ ├── deps.json │ │ │ │ ├── files.json │ │ │ │ └── tasks.json │ │ │ │ ├── LICENSE │ │ │ │ ├── openapitools.json │ │ │ │ ├── package.json │ │ │ │ ├── project.json │ │ │ │ ├── tsconfig.dev.json │ │ │ │ └── tsconfig.json │ │ └── runtime │ │ │ ├── README.md │ │ │ ├── python │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .openapi-generator-ignore │ │ │ ├── .pdk │ │ │ │ └── dynamic-files │ │ │ │ │ └── openapitools.json │ │ │ ├── .projen │ │ │ │ ├── deps.json │ │ │ │ ├── files.json │ │ │ │ └── tasks.json │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── openapitools.json │ │ │ ├── poetry.lock │ │ │ ├── project.json │ │ │ └── pyproject.toml │ │ │ └── typescript │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .openapi-generator-ignore │ │ │ ├── .pdk │ │ │ └── dynamic-files │ │ │ │ └── openapitools.json │ │ │ ├── .projen │ │ │ ├── deps.json │ │ │ ├── files.json │ │ │ └── tasks.json │ │ │ ├── LICENSE │ │ │ ├── openapitools.json │ │ │ ├── package.json │ │ │ ├── project.json │ │ │ ├── tsconfig.dev.json │ │ │ └── tsconfig.json │ ├── interceptors │ │ └── typescript │ │ │ ├── .eslintrc.json │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .prettierignore │ │ │ ├── .prettierrc.json │ │ │ ├── .projen │ │ │ ├── deps.json │ │ │ ├── files.json │ │ │ └── tasks.json │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ ├── project.json │ │ │ ├── src │ │ │ ├── index.ts │ │ │ ├── interceptors │ │ │ │ ├── cors.ts │ │ │ │ ├── identity.ts │ │ │ │ ├── index.ts │ │ │ │ ├── logger.ts │ │ │ │ ├── tracer.ts │ │ │ │ └── try-catch.ts │ │ │ └── utils │ │ │ │ ├── api-response.ts │ │ │ │ ├── cognito-auth.ts │ │ │ │ ├── index.ts │ │ │ │ └── uuid.ts │ │ │ ├── test │ │ │ └── identity.test.ts │ │ │ ├── tsconfig.dev.json │ │ │ └── tsconfig.json │ ├── model │ │ ├── .gitignore │ │ ├── .projen │ │ │ ├── files.json │ │ │ └── tasks.json │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle │ │ ├── generated │ │ │ └── main │ │ │ │ └── smithy │ │ │ │ └── aws-pdk │ │ │ │ └── prelude.smithy │ │ ├── project.json │ │ ├── settings.gradle │ │ ├── smithy-build.json │ │ └── src │ │ │ └── main │ │ │ └── smithy │ │ │ ├── chat │ │ │ ├── chat-message-sources.smithy │ │ │ ├── chat-messages.smithy │ │ │ ├── chat.smithy │ │ │ ├── config.smithy │ │ │ └── service.smithy │ │ │ ├── corpus │ │ │ └── service.smithy │ │ │ ├── llm │ │ │ └── service.smithy │ │ │ ├── main.smithy │ │ │ └── types.smithy │ └── project.json ├── corpus │ ├── .gitignore │ ├── .projen │ │ ├── files.json │ │ └── tasks.json │ ├── Dockerfile │ ├── LICENSE │ ├── README.md │ ├── docker-scripts │ │ ├── entry_script.sh │ │ ├── lambda_entry_script.sh │ │ └── sagemaker_entry_script.sh │ ├── logic │ │ ├── .eslintrc.json │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── .npmrc │ │ ├── .prettierignore │ │ ├── .prettierrc.json │ │ ├── .projen │ │ │ ├── deps.json │ │ │ ├── files.json │ │ │ └── tasks.json │ │ ├── LICENSE │ │ ├── README.md │ │ ├── package.json │ │ ├── project.json │ │ ├── src │ │ │ ├── api │ │ │ │ ├── handlers.ts │ │ │ │ ├── index.ts │ │ │ │ └── router.ts │ │ │ ├── embedding │ │ │ │ ├── index.ts │ │ │ │ └── util.ts │ │ │ ├── env.ts │ │ │ ├── indexing │ │ │ │ ├── datastore.ts │ │ │ │ ├── index.ts │ │ │ │ ├── utils.ts │ │ │ │ ├── vectorstore.ts │ │ │ │ └── worker.ts │ │ │ ├── metrics.ts │ │ │ └── vectorstore │ │ │ │ ├── index.ts │ │ │ │ └── management.ts │ │ ├── test │ │ │ ├── datastore.test.ts │ │ │ └── indexing.test.ts │ │ ├── tsconfig.dev.json │ │ └── tsconfig.json │ ├── project.json │ └── test │ │ ├── README.md │ │ └── events │ │ └── emdedding │ │ ├── embed-documents.json │ │ ├── embed-query.json │ │ └── similarity-search.json ├── infra │ ├── .eslintrc.json │ ├── .gitattributes │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc.json │ ├── .projen │ │ ├── deps.json │ │ ├── files.json │ │ └── tasks.json │ ├── LICENSE │ ├── README.md │ ├── cdk.json │ ├── package.json │ ├── project.json │ ├── src │ │ ├── application │ │ │ ├── ai │ │ │ │ ├── foundation-models │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── models.ts │ │ │ │ │ └── stack.ts │ │ │ │ └── inference-engine │ │ │ │ │ ├── engine │ │ │ │ │ ├── handler │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ ├── rest-handler │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ ├── shared │ │ │ │ │ │ │ ├── create-message.ts │ │ │ │ │ │ │ ├── env.ts │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ │ └── ws-handler │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── index.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── stack.ts │ │ │ ├── corpus │ │ │ │ ├── index.ts │ │ │ │ └── pipeline │ │ │ │ │ ├── handlers │ │ │ │ │ ├── inventory.ts │ │ │ │ │ └── task │ │ │ │ │ │ ├── config.ts │ │ │ │ │ │ ├── start.ts │ │ │ │ │ │ └── vectorstore │ │ │ │ │ │ ├── create-indexes │ │ │ │ │ │ ├── handler.ts │ │ │ │ │ │ ├── image │ │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ │ └── Dockerfile │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ └── setup.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── types.ts │ │ │ ├── data │ │ │ │ ├── app-data-layer.ts │ │ │ │ └── index.ts │ │ │ ├── identity │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── monitoring │ │ │ │ └── index.ts │ │ │ ├── networking │ │ │ │ ├── layer.ts │ │ │ │ └── stack.ts │ │ │ ├── presentation │ │ │ │ ├── index.ts │ │ │ │ └── lambdas │ │ │ │ │ ├── chat │ │ │ │ │ ├── createChat.ts │ │ │ │ │ ├── deleteChat.ts │ │ │ │ │ ├── deleteChatMessage.ts │ │ │ │ │ ├── listChatMessageSources.ts │ │ │ │ │ ├── listChatMessages.ts │ │ │ │ │ ├── listChats.ts │ │ │ │ │ └── updateChat.ts │ │ │ │ │ ├── llm │ │ │ │ │ └── inventory.ts │ │ │ │ │ └── websocket │ │ │ │ │ └── authorizer.ts │ │ │ ├── stack.ts │ │ │ ├── stage.ts │ │ │ ├── tags.ts │ │ │ └── tooling │ │ │ │ └── index.ts │ │ ├── cicd │ │ │ └── pipeline-stack.ts │ │ └── main.ts │ ├── test │ │ └── main.test.ts │ ├── tsconfig.dev.json │ └── tsconfig.json ├── overrides │ ├── .gitignore │ └── README.md ├── sample-dataset │ ├── .eslintrc.json │ ├── .gitattributes │ ├── .gitignore │ ├── .npmignore │ ├── .prettierignore │ ├── .prettierrc.json │ ├── .projen │ │ ├── deps.json │ │ ├── files.json │ │ └── tasks.json │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── project.json │ ├── scripts │ │ ├── generate.py │ │ └── requirements.txt │ ├── src │ │ └── index.ts │ ├── test │ │ └── index.test.ts │ ├── tsconfig.dev.json │ └── tsconfig.json ├── website │ ├── .eslintrc.json │ ├── .gitattributes │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc.json │ ├── .projen │ │ ├── deps.json │ │ ├── files.json │ │ ├── react-config-overrides.js │ │ └── tasks.json │ ├── .storybook │ │ ├── __mocks__ │ │ │ └── api-typescript-react-query-hooks.ts │ │ ├── main.ts │ │ └── preview.ts │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── project.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ ├── mockServiceWorker.js │ │ ├── robots.txt │ │ └── runtime-config.example.json │ ├── src │ │ ├── App.tsx │ │ ├── Auth.tsx │ │ ├── components │ │ │ ├── Empty.tsx │ │ │ ├── InlineEditor.tsx │ │ │ ├── buttons │ │ │ │ ├── CopyText.tsx │ │ │ │ └── ModalButton.tsx │ │ │ ├── chat │ │ │ │ ├── ChatPanel.tsx │ │ │ │ ├── ChatSplitPanel.tsx │ │ │ │ ├── ChatsList.tsx │ │ │ │ ├── ConversationView.tsx │ │ │ │ ├── Message.tsx │ │ │ │ ├── __stories__ │ │ │ │ │ ├── Chat.stories.tsx │ │ │ │ │ ├── ChatSplitPanel.stories.tsx │ │ │ │ │ ├── ChatsList.stories.tsx │ │ │ │ │ ├── Message.stories.tsx │ │ │ │ │ └── MessageConcepts.stories.tsx │ │ │ │ ├── components │ │ │ │ │ ├── DeleteChatButton.tsx │ │ │ │ │ ├── ExportChat.tsx │ │ │ │ │ ├── ExportChat.utils.ts │ │ │ │ │ ├── HumanInputForm.tsx │ │ │ │ │ └── SourceDocument.tsx │ │ │ │ ├── dev-settings │ │ │ │ │ ├── ChatConfigForm │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ ├── CustomModelEditor.tsx │ │ │ │ │ │ │ ├── EmbeddingModelSelector.tsx │ │ │ │ │ │ │ ├── FormFieldSet.tsx │ │ │ │ │ │ │ ├── ModelSelector.tsx │ │ │ │ │ │ │ └── PromptEditor.tsx │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ └── sections │ │ │ │ │ │ │ ├── HistorySettings.tsx │ │ │ │ │ │ │ ├── InferenceSettings.tsx │ │ │ │ │ │ │ ├── PromptSettings.tsx │ │ │ │ │ │ │ ├── SearchSettings.tsx │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── ChatConfigSplitPanel.tsx │ │ │ │ │ ├── fixtures │ │ │ │ │ │ └── prompt-inputs.ts │ │ │ │ │ └── utils.ts │ │ │ │ └── message │ │ │ │ │ ├── Concept1.tsx │ │ │ │ │ └── Concept3.tsx │ │ │ ├── code-editor.tsx │ │ │ ├── error │ │ │ │ ├── Error.tsx │ │ │ │ └── index.ts │ │ │ ├── prompts │ │ │ │ └── text │ │ │ │ │ ├── Display.tsx │ │ │ │ │ └── Input.tsx │ │ │ └── table-config.ts │ │ ├── config.json │ │ ├── hooks │ │ │ ├── chats.test.tsx │ │ │ ├── chats.ts │ │ │ ├── index.ts │ │ │ ├── llm-inventory.ts │ │ │ ├── use-stateful-ref.ts │ │ │ └── ws-chats.ts │ │ ├── index.tsx │ │ ├── mocks │ │ │ ├── browser.ts │ │ │ └── handlers.ts │ │ ├── pages │ │ │ ├── ApiExplorer │ │ │ │ └── index.tsx │ │ │ ├── Chat.tsx │ │ │ ├── CorpusSearch │ │ │ │ └── index.tsx │ │ │ ├── Embeddings │ │ │ │ └── index.tsx │ │ │ └── Settings.tsx │ │ ├── providers │ │ │ ├── ApiProvider.tsx │ │ │ ├── AppLayoutProvider │ │ │ │ ├── index.tsx │ │ │ │ └── managed-content │ │ │ │ │ ├── base.tsx │ │ │ │ │ ├── help-panel.tsx │ │ │ │ │ ├── index.ts │ │ │ │ │ └── split-panel.tsx │ │ │ ├── ChatEngineConfig.tsx │ │ │ ├── FlagsProvider.tsx │ │ │ ├── RiskProvider.tsx │ │ │ └── WebSocketApiProvider.tsx │ │ ├── react-app-env.d.ts │ │ ├── reportWebVitals.ts │ │ ├── setupTests.ts │ │ ├── styles.css │ │ └── types │ │ │ ├── dayjs.ts │ │ │ └── utils.ts │ ├── tsconfig.dev.json │ ├── tsconfig.json │ └── webpack │ │ ├── config-overrides.js │ │ └── console.js └── ws-api │ ├── .gitignore │ ├── .projen │ ├── files.json │ └── tasks.json │ ├── LICENSE │ ├── README.md │ ├── generated │ ├── infrastructure │ │ ├── README.md │ │ └── typescript │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .npmignore │ │ │ ├── .openapi-generator-ignore │ │ │ ├── .openapi-generator-ignore-handlebars │ │ │ ├── .pdk │ │ │ └── dynamic-files │ │ │ │ └── openapitools.json │ │ │ ├── .projen │ │ │ ├── deps.json │ │ │ ├── files.json │ │ │ └── tasks.json │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ ├── project.json │ │ │ ├── tsconfig.dev.json │ │ │ └── tsconfig.json │ ├── libraries │ │ ├── README.md │ │ ├── typescript-websocket-client │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .openapi-generator-ignore │ │ │ ├── .pdk │ │ │ │ └── dynamic-files │ │ │ │ │ └── openapitools.json │ │ │ ├── .projen │ │ │ │ ├── deps.json │ │ │ │ ├── files.json │ │ │ │ └── tasks.json │ │ │ ├── LICENSE │ │ │ ├── package.json │ │ │ ├── project.json │ │ │ ├── tsconfig.dev.json │ │ │ └── tsconfig.json │ │ └── typescript-websocket-hooks │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .openapi-generator-ignore │ │ │ ├── .pdk │ │ │ └── dynamic-files │ │ │ │ └── openapitools.json │ │ │ ├── .projen │ │ │ ├── deps.json │ │ │ ├── files.json │ │ │ └── tasks.json │ │ │ ├── LICENSE │ │ │ ├── package.json │ │ │ ├── project.json │ │ │ ├── tsconfig.dev.json │ │ │ └── tsconfig.json │ └── runtime │ │ ├── README.md │ │ └── typescript │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .openapi-generator-ignore │ │ ├── .pdk │ │ └── dynamic-files │ │ │ └── openapitools.json │ │ ├── .projen │ │ ├── deps.json │ │ ├── files.json │ │ └── tasks.json │ │ ├── LICENSE │ │ ├── package.json │ │ ├── project.json │ │ ├── tsconfig.dev.json │ │ └── tsconfig.json │ ├── handlers │ ├── README.md │ └── typescript │ │ ├── .eslintrc.json │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── .openapi-generator-ignore │ │ ├── .openapi-generator-ignore-handlebars │ │ ├── .pdk │ │ └── dynamic-files │ │ │ └── openapitools.json │ │ ├── .projen │ │ ├── deps.json │ │ ├── files.json │ │ └── tasks.json │ │ ├── LICENSE │ │ ├── README.md │ │ ├── package.json │ │ ├── project.json │ │ ├── src │ │ ├── $connect.ts │ │ ├── $disconnect.ts │ │ └── index.ts │ │ ├── tsconfig.dev.json │ │ └── tsconfig.json │ ├── model │ ├── .gitignore │ ├── .projen │ │ ├── files.json │ │ └── tasks.json │ ├── LICENSE │ ├── README.md │ ├── build.gradle │ ├── generated │ │ └── main │ │ │ └── smithy │ │ │ └── aws-pdk │ │ │ ├── async.smithy │ │ │ └── prelude.smithy │ ├── project.json │ ├── settings.gradle │ ├── smithy-build.json │ └── src │ │ └── main │ │ └── smithy │ │ ├── main.smithy │ │ ├── operations │ │ ├── send-chat-message.smithy │ │ ├── stream-llm-response.smithy │ │ └── update-inference-status.smithy │ │ └── types │ │ ├── chat.smithy │ │ ├── common.smithy │ │ └── config.smithy │ └── project.json ├── docs ├── .gitignore ├── content │ ├── .pages.yml │ ├── _ │ │ ├── abbreviations.md │ │ ├── aws-genai-llm-chatbot │ │ │ └── mention.md │ │ ├── disclaimer │ │ │ ├── prompt-engineering-template.md │ │ │ └── third-party-model.md │ │ ├── news-feed.md │ │ └── wip.md │ ├── assets │ │ ├── images │ │ │ ├── aws-logo.png │ │ │ ├── cloud-diagram.png │ │ │ ├── favicon.png │ │ │ ├── galileo-arch.png │ │ │ ├── logo.png │ │ │ └── ux-screenshot.png │ │ └── stylesheets │ │ │ └── extra.css │ ├── contributing │ │ └── index.md │ ├── developer-guide │ │ ├── .pages.yml │ │ ├── api │ │ │ ├── api-explorer-list.png │ │ │ └── index.md │ │ ├── chat-dev-settings │ │ │ ├── .pages.yml │ │ │ ├── _ │ │ │ │ └── header.md │ │ │ ├── history │ │ │ │ ├── index.md │ │ │ │ └── thumb.png │ │ │ ├── image-1.png │ │ │ ├── image-2.png │ │ │ ├── image.png │ │ │ ├── index.md │ │ │ ├── inference │ │ │ │ ├── image-1.png │ │ │ │ ├── image-2.png │ │ │ │ ├── image-3.png │ │ │ │ ├── image-4.png │ │ │ │ ├── image-5.png │ │ │ │ ├── image-6.png │ │ │ │ ├── image.png │ │ │ │ ├── index.md │ │ │ │ └── thumb.png │ │ │ ├── prompting │ │ │ │ ├── best-practices │ │ │ │ │ └── index.md │ │ │ │ ├── classify │ │ │ │ │ ├── image.png │ │ │ │ │ └── index.md │ │ │ │ ├── image-1.png │ │ │ │ ├── image-2.png │ │ │ │ ├── image-3.png │ │ │ │ ├── image-4.png │ │ │ │ ├── image.png │ │ │ │ ├── index.md │ │ │ │ └── thumb.png │ │ │ └── search │ │ │ │ ├── index.md │ │ │ │ └── thumb.png │ │ ├── cli │ │ │ ├── bulk-test │ │ │ │ └── index.md │ │ │ ├── deploy │ │ │ │ └── index.md │ │ │ ├── document-upload │ │ │ │ └── index.md │ │ │ ├── index.md │ │ │ └── user-management │ │ │ │ └── index.md │ │ ├── design │ │ │ └── index.md │ │ ├── docs │ │ │ └── index.md │ │ ├── index.md │ │ ├── models │ │ │ ├── bedrock-models.md │ │ │ ├── index.md │ │ │ └── predefined-models.md │ │ ├── path-to-prod │ │ │ └── index.md │ │ ├── tooling │ │ │ └── index.md │ │ ├── troubleshooting │ │ │ └── index.md │ │ ├── uistate │ │ │ ├── data-flow.png │ │ │ └── index.md │ │ ├── vector-store │ │ │ ├── index.md │ │ │ └── indexing-workflow.png │ │ └── website │ │ │ └── index.md │ ├── getting-started │ │ ├── .pages.yml │ │ ├── cloud9-ide.md │ │ ├── deploying-galileo.md │ │ ├── images │ │ │ ├── cfn-galileo-stacks.png │ │ │ ├── cli-select.png │ │ │ ├── galileo-chat.png │ │ │ ├── galileo-login-screen.png │ │ │ └── galileo-stack-outputs.png │ │ ├── index.md │ │ ├── prerequisites.md │ │ └── validate-deployment.md │ ├── index.md │ ├── overrides │ │ └── home.html │ ├── overview │ │ ├── .pages.yml │ │ ├── galileo-chat.png │ │ ├── how │ │ │ ├── index.md │ │ │ ├── question-answer.png │ │ │ └── rag-flow.png │ │ ├── index.md │ │ ├── model │ │ │ ├── index.md │ │ │ └── mental-model.png │ │ ├── security │ │ │ └── index.md │ │ └── tooling.png │ ├── troubleshooting │ │ └── index.md │ ├── user-guide │ │ └── index.md │ └── whats-new │ │ └── index.md ├── javascripts │ └── mathjax.js ├── mkdocs.yml ├── poetry.lock ├── pyproject.toml └── scripts │ ├── build.sh │ ├── get-deps.sh │ └── serve.sh ├── nx.json ├── package.json ├── packages ├── README.md ├── galileo-cdk │ ├── .eslintrc.json │ ├── .gitattributes │ ├── .gitignore │ ├── .npmignore │ ├── .prettierignore │ ├── .prettierrc.json │ ├── .projen │ │ ├── deps.json │ │ ├── files.json │ │ └── tasks.json │ ├── API.md │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── project.json │ ├── src │ │ ├── ai │ │ │ ├── llms │ │ │ │ ├── framework │ │ │ │ │ ├── base.ts │ │ │ │ │ ├── bedrock │ │ │ │ │ │ ├── constants.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── utils.ts │ │ │ │ │ ├── eula │ │ │ │ │ │ ├── context.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── existing.ts │ │ │ │ │ ├── huggingface │ │ │ │ │ │ ├── base.ts │ │ │ │ │ │ ├── container-images.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── model-tar │ │ │ │ │ │ │ ├── handler │ │ │ │ │ │ │ ├── base.ts │ │ │ │ │ │ │ ├── isComplete-function.ts │ │ │ │ │ │ │ ├── isComplete.lambda.ts │ │ │ │ │ │ │ ├── onEvent-function.ts │ │ │ │ │ │ │ └── onEvent.lambda.ts │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ ├── source-asset.ts │ │ │ │ │ │ │ ├── source.asset │ │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ │ ├── build.py │ │ │ │ │ │ │ ├── poetry.lock │ │ │ │ │ │ │ ├── pyproject.toml │ │ │ │ │ │ │ └── test_build.py │ │ │ │ │ │ │ └── types.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── jumpstart │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── sagemaker │ │ │ │ │ │ ├── image-repository-mapping.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── model-info │ │ │ │ │ │ │ ├── code-asset.ts │ │ │ │ │ │ │ ├── code.asset │ │ │ │ │ │ │ ├── index.py │ │ │ │ │ │ │ ├── poetry.lock │ │ │ │ │ │ │ ├── pyproject.toml │ │ │ │ │ │ │ └── sagemaker_uri.py │ │ │ │ │ │ │ └── custom-resource.ts │ │ │ │ │ └── utils.ts │ │ │ │ └── models │ │ │ │ │ ├── ai21 │ │ │ │ │ ├── index.ts │ │ │ │ │ └── jurassic2-ultra.ts │ │ │ │ │ ├── falcon │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── lite │ │ │ │ │ │ ├── image-asset.ts │ │ │ │ │ │ ├── image.asset │ │ │ │ │ │ │ ├── Dockerfile │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── layers.py │ │ │ │ │ │ │ └── sagemaker-entrypoint.sh │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── tgi │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── managed-embeddings │ │ │ │ │ ├── custom-asset.ts │ │ │ │ │ ├── custom.asset │ │ │ │ │ │ └── code │ │ │ │ │ │ │ ├── inference.py │ │ │ │ │ │ │ └── requirements.txt │ │ │ │ │ └── index.ts │ │ │ │ │ ├── meta │ │ │ │ │ ├── index.ts │ │ │ │ │ └── llama2.ts │ │ │ │ │ └── sentence-transformer │ │ │ │ │ ├── custom-asset.ts │ │ │ │ │ ├── custom.asset │ │ │ │ │ └── code │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── inference.py │ │ │ │ │ └── index.ts │ │ │ └── predefined │ │ │ │ ├── ids.ts │ │ │ │ ├── index.ts │ │ │ │ └── models.ts │ │ ├── common │ │ │ ├── index.ts │ │ │ ├── resources │ │ │ │ ├── index.ts │ │ │ │ ├── secure-bucket │ │ │ │ │ └── index.ts │ │ │ │ └── service-quota │ │ │ │ │ ├── handler-function.ts │ │ │ │ │ ├── handler.lambda.ts │ │ │ │ │ └── index.ts │ │ │ └── utils │ │ │ │ └── index.ts │ │ ├── core │ │ │ ├── app │ │ │ │ ├── context │ │ │ │ │ ├── defaults.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── types.ts │ │ │ │ │ └── utils.ts │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── data │ │ │ ├── corpus │ │ │ │ ├── index.ts │ │ │ │ └── vectorstore │ │ │ │ │ ├── index.ts │ │ │ │ │ └── rds.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ └── tooling │ │ │ ├── index.ts │ │ │ ├── nag │ │ │ └── index.ts │ │ │ ├── pgadmin │ │ │ └── index.ts │ │ │ └── sagemaker │ │ │ ├── index.ts │ │ │ └── studio │ │ │ └── index.ts │ ├── test │ │ └── hello.test.ts │ └── tsconfig.dev.json ├── galileo-cli │ ├── .eslintrc.json │ ├── .gitattributes │ ├── .gitignore │ ├── .npmignore │ ├── .prettierignore │ ├── .prettierrc.json │ ├── .projen │ │ ├── deps.json │ │ ├── files.json │ │ └── tasks.json │ ├── LICENSE │ ├── README.md │ ├── bin │ │ └── galileo-cli.ts │ ├── examples │ │ ├── README.md │ │ ├── csv-loader │ │ │ ├── example.csv │ │ │ ├── metadata-provider-object.ts │ │ │ ├── metadata-provider-string.ts │ │ │ └── parser-common.ts │ │ ├── excel-loader │ │ │ ├── example.xlsx │ │ │ ├── excel-loader.ts │ │ │ └── index.ts │ │ └── simple-upload │ │ │ ├── example-file.txt │ │ │ └── metadata.json │ ├── package.json │ ├── project.json │ ├── src │ │ ├── commands │ │ │ ├── cognito │ │ │ │ ├── auth │ │ │ │ │ └── index.ts │ │ │ │ ├── bulk-create-users │ │ │ │ │ └── index.ts │ │ │ │ ├── create-user │ │ │ │ │ └── index.ts │ │ │ │ ├── delete-user │ │ │ │ │ └── index.ts │ │ │ │ └── flags.ts │ │ │ ├── deploy │ │ │ │ ├── flags.ts │ │ │ │ └── index.ts │ │ │ ├── document │ │ │ │ ├── flags.ts │ │ │ │ └── upload │ │ │ │ │ └── index.ts │ │ │ └── invoke │ │ │ │ └── chat-bulk │ │ │ │ └── index.ts │ │ ├── hooks │ │ │ └── init │ │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── internals │ │ │ └── index.ts │ │ └── lib │ │ │ ├── account-utils │ │ │ ├── bedrock.ts │ │ │ ├── cognito.ts │ │ │ ├── get-aws-account-id.ts │ │ │ ├── get-bootstrap-info.ts │ │ │ ├── index.ts │ │ │ ├── s3.ts │ │ │ ├── sfn.ts │ │ │ ├── signed-fetch.ts │ │ │ └── util.ts │ │ │ ├── context │ │ │ ├── index.ts │ │ │ └── ui.ts │ │ │ ├── document │ │ │ ├── document-metadata.ts │ │ │ ├── index.ts │ │ │ ├── metadata-provider.ts │ │ │ └── metadata.schema.json │ │ │ ├── prompts │ │ │ └── index.ts │ │ │ └── types │ │ │ ├── errors.ts │ │ │ └── index.ts │ ├── test │ │ └── .gitkeep │ ├── tsconfig.dev.json │ └── tsconfig.json └── galileo-sdk │ ├── .eslintrc.json │ ├── .gitattributes │ ├── .gitignore │ ├── .npmignore │ ├── .prettierignore │ ├── .prettierrc.json │ ├── .projen │ ├── deps.json │ ├── files.json │ └── tasks.json │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── project.json │ ├── scripts │ └── lib-cjs.js │ ├── src │ ├── auth │ │ └── aws-sigv4 │ │ │ └── index.ts │ ├── chat │ │ ├── callback.ts │ │ ├── chain.ts │ │ ├── config │ │ │ ├── index.test.ts │ │ │ └── index.ts │ │ ├── context.ts │ │ ├── dynamodb │ │ │ ├── index.ts │ │ │ ├── lib │ │ │ │ ├── chat.ts │ │ │ │ ├── index.ts │ │ │ │ ├── messages.ts │ │ │ │ ├── sources.ts │ │ │ │ └── util.ts │ │ │ └── message-history.ts │ │ ├── engine.ts │ │ ├── index.ts │ │ ├── memory.ts │ │ └── search.ts │ ├── common │ │ ├── env.ts │ │ ├── index.ts │ │ ├── logging │ │ │ ├── browser.ts │ │ │ └── index.ts │ │ ├── metrics │ │ │ └── index.ts │ │ └── types.ts │ ├── index.ts │ ├── langchain │ │ ├── embeddings │ │ │ └── sagemager_endpoint.ts │ │ ├── output_parsers │ │ │ └── pojo.ts │ │ ├── patch.ts │ │ └── stores │ │ │ └── messages │ │ │ └── utils.ts │ ├── models │ │ ├── adapter.ts │ │ ├── adapters.spec.ts │ │ ├── constants.ts │ │ ├── cross-account.ts │ │ ├── env.ts │ │ ├── index.ts │ │ ├── inventory.ts │ │ ├── llms │ │ │ ├── anthropic │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── claude.test.ts.snap │ │ │ │ ├── claude.test.ts │ │ │ │ ├── claude.ts │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── meta │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── llama2.test.ts.snap │ │ │ │ ├── index.ts │ │ │ │ ├── llama2.test.ts │ │ │ │ └── llama2.ts │ │ │ ├── openassistant │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── falcon.test.ts.snap │ │ │ │ ├── falcon.test.ts │ │ │ │ ├── falcon.ts │ │ │ │ └── index.ts │ │ │ └── utils.ts │ │ └── types.ts │ ├── prompt │ │ ├── handlebars.ts │ │ ├── index.ts │ │ ├── templates │ │ │ ├── chat │ │ │ │ ├── base.ts │ │ │ │ ├── classify.ts │ │ │ │ ├── condense-question.ts │ │ │ │ ├── index.ts │ │ │ │ └── question-answer.ts │ │ │ ├── index.ts │ │ │ └── store │ │ │ │ ├── registry.ts │ │ │ │ ├── resolver.ts │ │ │ │ └── system.ts │ │ └── types.ts │ ├── schema │ │ └── index.ts │ ├── types │ │ └── global.d.ts │ ├── utils │ │ ├── bedrock.ts │ │ └── merge.ts │ └── vectorstores │ │ ├── index.ts │ │ └── pgvector │ │ ├── index.ts │ │ ├── rds.ts │ │ └── utils.ts │ ├── test │ ├── README.md │ └── chat │ │ ├── bedrock.integ.ts │ │ ├── engine-classify.test.ts │ │ └── engine.test.ts │ ├── tsconfig.cjs.json │ ├── tsconfig.dev.json │ └── tsconfig.json ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── prerequisite-check.sh ├── projenrc ├── components │ ├── awscdk │ │ └── assets.ts │ ├── esm-typescript │ │ ├── index.ts │ │ ├── pkg-exports.ts │ │ └── scripts │ │ │ └── lib-cjs.js │ └── python.ts ├── constants.ts ├── demo │ ├── api.ts │ ├── corpus.ts │ ├── index.ts │ ├── infra.ts │ ├── sample.ts │ └── website.ts ├── framework │ ├── galileo-cdk.ts │ ├── galileo-cli.ts │ ├── galileo-sdk.ts │ └── index.ts ├── helpers │ ├── extract-peer-deps.ts │ └── withStorybook.ts ├── index.ts └── monorepo.ts ├── scripts ├── git-secrets-scan.sh └── oss.ts ├── selected-options.json ├── tsconfig.dev.json └── tsconfig.json /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | blank_issues_enabled: false 3 | contact_links: 4 | - name: 💬 General Question 5 | url: https://github.com/aws-samples/aws-genai-conversational-rag-reference/discussions/categories/q-a 6 | about: Please ask and answer questions as a discussion thread 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "📕 Documentation Issue" 3 | description: Report an issue in the API Reference documentation or Developer Guide 4 | title: "[DOCS] (short issue description)" 5 | labels: [documentation, needs-triage] 6 | # assignees: [] 7 | body: 8 | - type: textarea 9 | id: description 10 | attributes: 11 | label: Describe the issue 12 | description: A clear and concise description of the issue. 13 | validations: 14 | required: true 15 | - type: textarea 16 | id: links 17 | attributes: 18 | label: Links 19 | description: | 20 | Include links to affected documentation page(s). 21 | validations: 22 | required: true 23 | -------------------------------------------------------------------------------- /.github/workflows/pull-request-lint.yml: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". 2 | 3 | name: pull-request-lint 4 | on: 5 | pull_request_target: 6 | types: 7 | - labeled 8 | - opened 9 | - synchronize 10 | - reopened 11 | - ready_for_review 12 | - edited 13 | jobs: 14 | validate: 15 | name: Validate PR title 16 | runs-on: ubuntu-latest 17 | permissions: 18 | pull-requests: write 19 | steps: 20 | - uses: amannn/action-semantic-pull-request@v5.4.0 21 | env: 22 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 23 | with: 24 | types: |- 25 | feat 26 | fix 27 | chore 28 | requireScope: false 29 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | pnpm commitlint --edit 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eo pipefail 3 | 4 | . "$(dirname "$0")/_/husky.sh" 5 | 6 | PRE_SHA="$(git diff HEAD --ignore-space-at-eol | shasum -a 256 --tag)" 7 | 8 | pnpm projen 9 | pnpm nx affected --target=eslint-staged --uncommitted 10 | pnpm projen eslint-staged 11 | 12 | POST_SHA="$(git diff HEAD --ignore-space-at-eol | shasum -a 256 --tag)" 13 | 14 | if [ "$PRE_SHA" != "$POST_SHA" ] 15 | then 16 | RED='\033[0;31m' 17 | NC='\033[0m' # No Color 18 | echo "${RED}Pre-commit modified your working directory${NC} (eg: projen, eslint --fix)" 19 | echo "${RED}Please verify and stage changed, then retry git commit${NC}" 20 | exit 1 21 | fi 22 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". 2 | 3 | resolution-mode=highest 4 | yes=true 5 | prefer-workspace-packages=true 6 | link-workspace-packages=true 7 | -------------------------------------------------------------------------------- /.nxignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". 2 | .tmp 3 | .env 4 | .pytest_cache 5 | **/.venv/**/* 6 | **/cdk.out/**/* 7 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". 2 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "singleQuote": true, 4 | "printWidth": 120, 5 | "overrides": [ 6 | { 7 | "files": [ 8 | "**/*.ts", 9 | "**/*.tsx" 10 | ], 11 | "options": { 12 | "trailingComma": "all", 13 | "singleQuote": true, 14 | "printWidth": 120 15 | } 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.syncpackrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "filter": ".", 3 | "indent": " ", 4 | "semverGroups": [ 5 | { 6 | "dependencies": [ 7 | "**" 8 | ], 9 | "dependencyTypes": [ 10 | "**" 11 | ], 12 | "packages": [ 13 | "**" 14 | ], 15 | "range": "" 16 | } 17 | ], 18 | "sortAz": [ 19 | "contributors", 20 | "dependencies", 21 | "devDependencies", 22 | "keywords", 23 | "peerDependencies", 24 | "resolutions", 25 | "scripts" 26 | ], 27 | "sortFirst": [ 28 | "name", 29 | "description", 30 | "version", 31 | "author" 32 | ], 33 | "source": [], 34 | "versionGroups": [], 35 | "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"pnpm exec projen\"." 36 | } 37 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "esbenp.prettier-vscode", 5 | "smithy.smithy-vscode-extension", 6 | "vscjava.vscode-gradle", 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # TBD 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /HEADER: -------------------------------------------------------------------------------- 1 | ! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 3 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | aws-galileo 2 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | node_modules/ 3 | !/.gitattributes 4 | !/.projen/tasks.json 5 | !/.projen/deps.json 6 | !/.projen/files.json 7 | !/project.json 8 | -------------------------------------------------------------------------------- /demo/api/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | node_modules/ 3 | !/.gitattributes 4 | !/.projen/tasks.json 5 | !/.projen/deps.json 6 | !/.projen/files.json 7 | !/project.json 8 | !/LICENSE 9 | -------------------------------------------------------------------------------- /demo/api/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".gitattributes", 4 | ".gitignore", 5 | ".projen/deps.json", 6 | ".projen/files.json", 7 | ".projen/tasks.json", 8 | "LICENSE", 9 | "project.json" 10 | ], 11 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 12 | } 13 | -------------------------------------------------------------------------------- /demo/api/generated/documentation/README.md: -------------------------------------------------------------------------------- 1 | ## Generated Documentation 2 | 3 | This directory contains generated documentation based on your API model. -------------------------------------------------------------------------------- /demo/api/generated/documentation/html2/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | node_modules/ 3 | !/.gitattributes 4 | !/.projen/tasks.json 5 | !/.projen/deps.json 6 | !/.projen/files.json 7 | !/.pdk/dynamic-files/openapitools.json 8 | /openapitools.json 9 | .openapi-generator 10 | index.html 11 | !/project.json 12 | !/LICENSE 13 | -------------------------------------------------------------------------------- /demo/api/generated/documentation/html2/.pdk/dynamic-files/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "6.3.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/generated/documentation/html2/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".gitattributes", 4 | ".gitignore", 5 | ".pdk/dynamic-files/openapitools.json", 6 | ".projen/deps.json", 7 | ".projen/files.json", 8 | ".projen/tasks.json", 9 | "LICENSE", 10 | "project.json" 11 | ], 12 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 13 | } 14 | -------------------------------------------------------------------------------- /demo/api/generated/documentation/html2/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "6.3.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/README.md: -------------------------------------------------------------------------------- 1 | ## Generated Infrastructure 2 | 3 | This directory contains a generated type-safe CDK construct which can provision the API gateway infrastructure for an API based on your model. -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/typescript/.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | /.gitattributes linguist-generated 4 | /.gitignore linguist-generated 5 | /.npmignore linguist-generated 6 | /.npmrc linguist-generated 7 | /.openapi-generator-ignore linguist-generated 8 | /.openapi-generator-ignore-handlebars linguist-generated 9 | /.pdk/dynamic-files/openapitools.json linguist-generated 10 | /.projen/** linguist-generated 11 | /.projen/deps.json linguist-generated 12 | /.projen/files.json linguist-generated 13 | /.projen/tasks.json linguist-generated 14 | /LICENSE linguist-generated 15 | /package.json linguist-generated 16 | /pnpm-lock.yaml linguist-generated 17 | /project.json linguist-generated 18 | /tsconfig.dev.json linguist-generated 19 | /tsconfig.json linguist-generated -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/typescript/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | !/.gitattributes 3 | !/.projen/tasks.json 4 | !/.projen/deps.json 5 | !/.projen/files.json 6 | !/package.json 7 | !/LICENSE 8 | logs 9 | *.log 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | lerna-debug.log* 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | lib-cov 20 | coverage 21 | *.lcov 22 | .nyc_output 23 | build/Release 24 | node_modules/ 25 | jspm_packages/ 26 | *.tsbuildinfo 27 | .eslintcache 28 | *.tgz 29 | .yarn-integrity 30 | .cache 31 | !/.npmrc 32 | !/test/ 33 | !/tsconfig.json 34 | !/tsconfig.dev.json 35 | !/src/ 36 | /lib 37 | /dist/ 38 | !/.npmignore 39 | !/.openapi-generator-ignore 40 | !/.openapi-generator-ignore-handlebars 41 | !/.pdk/dynamic-files/openapitools.json 42 | /openapitools.json 43 | /assets/api.json 44 | src 45 | .openapi-generator 46 | mocks 47 | !/project.json 48 | -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/typescript/.npmignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | /.projen/ 3 | /src 4 | /dist 5 | -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/typescript/.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | .gitignore 3 | /* 4 | **/* 5 | * 6 | !src/index.ts 7 | !src/api.ts 8 | !src/mock-integrations.ts 9 | -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/typescript/.openapi-generator-ignore-handlebars: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | /* 3 | **/* 4 | * 5 | !src/__functions.ts 6 | -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/typescript/.pdk/dynamic-files/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "6.3.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/typescript/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".gitattributes", 4 | ".gitignore", 5 | ".npmignore", 6 | ".openapi-generator-ignore", 7 | ".openapi-generator-ignore-handlebars", 8 | ".pdk/dynamic-files/openapitools.json", 9 | ".projen/deps.json", 10 | ".projen/files.json", 11 | ".projen/tasks.json", 12 | "LICENSE", 13 | "project.json", 14 | "tsconfig.dev.json", 15 | "tsconfig.json" 16 | ], 17 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 18 | } 19 | -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/typescript/README.md: -------------------------------------------------------------------------------- 1 | # replace this -------------------------------------------------------------------------------- /demo/api/generated/infrastructure/typescript/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "6.3.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/generated/libraries/README.md: -------------------------------------------------------------------------------- 1 | ## Generated Libraries 2 | 3 | This directory contains generated libraries based on your API model. -------------------------------------------------------------------------------- /demo/api/generated/libraries/typescript-react-query-hooks/.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | /.gitattributes linguist-generated 4 | /.gitignore linguist-generated 5 | /.npmrc linguist-generated 6 | /.openapi-generator-ignore linguist-generated 7 | /.openapi-generator-ignore-handlebars linguist-generated 8 | /.pdk/dynamic-files/openapitools.json linguist-generated 9 | /.projen/** linguist-generated 10 | /.projen/deps.json linguist-generated 11 | /.projen/files.json linguist-generated 12 | /.projen/tasks.json linguist-generated 13 | /LICENSE linguist-generated 14 | /package.json linguist-generated 15 | /pnpm-lock.yaml linguist-generated 16 | /project.json linguist-generated 17 | /tsconfig.dev.json linguist-generated 18 | /tsconfig.json linguist-generated -------------------------------------------------------------------------------- /demo/api/generated/libraries/typescript-react-query-hooks/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | !/.gitattributes 3 | !/.projen/tasks.json 4 | !/.projen/deps.json 5 | !/.projen/files.json 6 | !/package.json 7 | !/LICENSE 8 | logs 9 | *.log 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | lerna-debug.log* 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | lib-cov 20 | coverage 21 | *.lcov 22 | .nyc_output 23 | build/Release 24 | node_modules/ 25 | jspm_packages/ 26 | *.tsbuildinfo 27 | .eslintcache 28 | *.tgz 29 | .yarn-integrity 30 | .cache 31 | !/.npmrc 32 | !/test/ 33 | !/tsconfig.json 34 | !/tsconfig.dev.json 35 | !/src/ 36 | /lib 37 | /dist/ 38 | !/.openapi-generator-ignore 39 | !/.pdk/dynamic-files/openapitools.json 40 | /openapitools.json 41 | src 42 | .npmignore 43 | README.md 44 | .openapi-generator 45 | !/.openapi-generator-ignore-handlebars 46 | !/project.json 47 | -------------------------------------------------------------------------------- /demo/api/generated/libraries/typescript-react-query-hooks/.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | .gitignore 3 | package.json 4 | tsconfig.json 5 | tsconfig.esm.json 6 | .npmignore 7 | **/*Hooks.ts 8 | -------------------------------------------------------------------------------- /demo/api/generated/libraries/typescript-react-query-hooks/.openapi-generator-ignore-handlebars: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | /* 3 | **/* 4 | * 5 | !**/*Hooks.ts 6 | -------------------------------------------------------------------------------- /demo/api/generated/libraries/typescript-react-query-hooks/.pdk/dynamic-files/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "6.3.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/generated/libraries/typescript-react-query-hooks/.projen/deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | { 4 | "name": "@types/node", 5 | "version": "^18", 6 | "type": "build" 7 | }, 8 | { 9 | "name": "@types/react", 10 | "type": "build" 11 | }, 12 | { 13 | "name": "constructs", 14 | "version": "^10.0.0", 15 | "type": "build" 16 | }, 17 | { 18 | "name": "projen", 19 | "version": "^0.79.24", 20 | "type": "build" 21 | }, 22 | { 23 | "name": "react", 24 | "type": "build" 25 | }, 26 | { 27 | "name": "typescript", 28 | "type": "build" 29 | }, 30 | { 31 | "name": "react", 32 | "type": "peer" 33 | }, 34 | { 35 | "name": "@tanstack/react-query", 36 | "version": "^4", 37 | "type": "runtime" 38 | } 39 | ], 40 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 41 | } 42 | -------------------------------------------------------------------------------- /demo/api/generated/libraries/typescript-react-query-hooks/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".gitattributes", 4 | ".gitignore", 5 | ".openapi-generator-ignore", 6 | ".openapi-generator-ignore-handlebars", 7 | ".pdk/dynamic-files/openapitools.json", 8 | ".projen/deps.json", 9 | ".projen/files.json", 10 | ".projen/tasks.json", 11 | "LICENSE", 12 | "project.json", 13 | "tsconfig.dev.json", 14 | "tsconfig.json" 15 | ], 16 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 17 | } 18 | -------------------------------------------------------------------------------- /demo/api/generated/libraries/typescript-react-query-hooks/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "6.3.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/README.md: -------------------------------------------------------------------------------- 1 | ## Generated Runtimes 2 | 3 | This directory contains generated runtime projects based on your API model. 4 | 5 | Each runtime project includes types from your API model, as well as type-safe client and server code. -------------------------------------------------------------------------------- /demo/api/generated/runtime/python/.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | /.gitattributes linguist-generated 4 | /.gitignore linguist-generated 5 | /.openapi-generator-ignore linguist-generated 6 | /.pdk/dynamic-files/openapitools.json linguist-generated 7 | /.projen/** linguist-generated 8 | /.projen/deps.json linguist-generated 9 | /.projen/files.json linguist-generated 10 | /.projen/tasks.json linguist-generated 11 | /LICENSE linguist-generated 12 | /project.json linguist-generated 13 | /pyproject.toml linguist-generated -------------------------------------------------------------------------------- /demo/api/generated/runtime/python/.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | .gitignore 3 | test 4 | test/* 5 | test/**/* 6 | .github 7 | .github/* 8 | .github/**/* 9 | .gitlab-ci.yml 10 | .travis.yml 11 | git_push.sh 12 | tox.ini 13 | requirements.txt 14 | test-requirements.txt 15 | setup.py 16 | setup.cfg 17 | pyproject.toml 18 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/python/.pdk/dynamic-files/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "7.1.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/python/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".gitattributes", 4 | ".gitignore", 5 | ".openapi-generator-ignore", 6 | ".pdk/dynamic-files/openapitools.json", 7 | ".projen/deps.json", 8 | ".projen/files.json", 9 | ".projen/tasks.json", 10 | "LICENSE", 11 | "poetry.toml", 12 | "project.json", 13 | "pyproject.toml" 14 | ], 15 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 16 | } 17 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/python/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "7.1.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/python/pyproject.toml: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | [tool.poetry] 4 | name = "api-python-runtime" 5 | version = "0.0.0" 6 | description = "" 7 | authors = [ "APJ Cope " ] 8 | readme = "README.md" 9 | include = [ "api_python_runtime", "api_python_runtime/**/*.py" ] 10 | 11 | [[tool.poetry.packages]] 12 | include = "api_python_runtime" 13 | 14 | [tool.poetry.dependencies] 15 | aenum = "^3.1.11" 16 | certifi = "^2023.5.7" 17 | pydantic = "^2.5.2" 18 | python-dateutil = "~2.8.2" 19 | python = "^3.10" 20 | typing_extensions = "^4.7.1" 21 | urllib3 = ">=1.25.4,<1.27" 22 | 23 | [tool.poetry.dependencies.aws-lambda-powertools] 24 | extras = [ "tracer", "aws-sdk" ] 25 | version = "^2.28.0" 26 | 27 | [tool.poetry.group.dev] 28 | dependencies = { } 29 | 30 | [build-system] 31 | requires = [ "poetry-core" ] 32 | build-backend = "poetry.core.masonry.api" 33 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/typescript/.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | /.gitattributes linguist-generated 4 | /.gitignore linguist-generated 5 | /.npmignore linguist-generated 6 | /.npmrc linguist-generated 7 | /.openapi-generator-ignore linguist-generated 8 | /.pdk/dynamic-files/openapitools.json linguist-generated 9 | /.projen/** linguist-generated 10 | /.projen/deps.json linguist-generated 11 | /.projen/files.json linguist-generated 12 | /.projen/tasks.json linguist-generated 13 | /LICENSE linguist-generated 14 | /package.json linguist-generated 15 | /pnpm-lock.yaml linguist-generated 16 | /project.json linguist-generated 17 | /tsconfig.dev.json linguist-generated 18 | /tsconfig.json linguist-generated -------------------------------------------------------------------------------- /demo/api/generated/runtime/typescript/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | !/.gitattributes 3 | !/.projen/tasks.json 4 | !/.projen/deps.json 5 | !/.projen/files.json 6 | !/package.json 7 | !/LICENSE 8 | logs 9 | *.log 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | lerna-debug.log* 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | lib-cov 20 | coverage 21 | *.lcov 22 | .nyc_output 23 | build/Release 24 | node_modules/ 25 | jspm_packages/ 26 | *.tsbuildinfo 27 | .eslintcache 28 | *.tgz 29 | .yarn-integrity 30 | .cache 31 | !/.npmrc 32 | !/test/ 33 | !/tsconfig.json 34 | !/tsconfig.dev.json 35 | !/src/ 36 | /lib 37 | /dist/ 38 | !/.npmignore 39 | !/.openapi-generator-ignore 40 | !/.pdk/dynamic-files/openapitools.json 41 | /openapitools.json 42 | src 43 | .npmignore 44 | README.md 45 | .openapi-generator 46 | !/project.json 47 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/typescript/.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | .gitignore 3 | package.json 4 | tsconfig.json 5 | tsconfig.esm.json 6 | .npmignore 7 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/typescript/.pdk/dynamic-files/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "6.3.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/typescript/.projen/deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | { 4 | "name": "@types/node", 5 | "version": "^18", 6 | "type": "build" 7 | }, 8 | { 9 | "name": "constructs", 10 | "version": "^10.0.0", 11 | "type": "build" 12 | }, 13 | { 14 | "name": "projen", 15 | "version": "^0.79.24", 16 | "type": "build" 17 | }, 18 | { 19 | "name": "typescript", 20 | "type": "build" 21 | }, 22 | { 23 | "name": "@aws-lambda-powertools/logger", 24 | "type": "runtime" 25 | }, 26 | { 27 | "name": "@aws-lambda-powertools/metrics", 28 | "type": "runtime" 29 | }, 30 | { 31 | "name": "@aws-lambda-powertools/tracer", 32 | "type": "runtime" 33 | }, 34 | { 35 | "name": "@types/aws-lambda", 36 | "type": "runtime" 37 | } 38 | ], 39 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 40 | } 41 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/typescript/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".gitattributes", 4 | ".gitignore", 5 | ".npmignore", 6 | ".openapi-generator-ignore", 7 | ".pdk/dynamic-files/openapitools.json", 8 | ".projen/deps.json", 9 | ".projen/files.json", 10 | ".projen/tasks.json", 11 | "LICENSE", 12 | "project.json", 13 | "tsconfig.dev.json", 14 | "tsconfig.json" 15 | ], 16 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 17 | } 18 | -------------------------------------------------------------------------------- /demo/api/generated/runtime/typescript/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "6.3.0", 6 | "storageDir": "~/.open-api-generator-cli" 7 | }, 8 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 9 | } 10 | -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | /.eslintrc.json linguist-generated 4 | /.gitattributes linguist-generated 5 | /.gitignore linguist-generated 6 | /.npmrc linguist-generated 7 | /.prettierignore linguist-generated 8 | /.prettierrc.json linguist-generated 9 | /.projen/** linguist-generated 10 | /.projen/deps.json linguist-generated 11 | /.projen/files.json linguist-generated 12 | /.projen/tasks.json linguist-generated 13 | /LICENSE linguist-generated 14 | /package.json linguist-generated 15 | /pnpm-lock.yaml linguist-generated 16 | /project.json linguist-generated 17 | /tsconfig.dev.json linguist-generated 18 | /tsconfig.json linguist-generated -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | !/.gitattributes 3 | !/.projen/tasks.json 4 | !/.projen/deps.json 5 | !/.projen/files.json 6 | !/package.json 7 | !/LICENSE 8 | logs 9 | *.log 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | lerna-debug.log* 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | lib-cov 20 | coverage 21 | *.lcov 22 | .nyc_output 23 | build/Release 24 | node_modules/ 25 | jspm_packages/ 26 | *.tsbuildinfo 27 | .eslintcache 28 | *.tgz 29 | .yarn-integrity 30 | .cache 31 | /test-reports/ 32 | junit.xml 33 | /coverage/ 34 | !/.prettierignore 35 | !/.prettierrc.json 36 | !/.npmrc 37 | !/test/ 38 | !/tsconfig.json 39 | !/tsconfig.dev.json 40 | !/src/ 41 | /lib 42 | /dist/ 43 | !/.eslintrc.json 44 | !/project.json 45 | -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/.prettierignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [ 3 | { 4 | "files": [ 5 | "**/*.ts", 6 | "**/*.tsx" 7 | ], 8 | "options": { 9 | "trailingComma": "all", 10 | "singleQuote": true, 11 | "printWidth": 120 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".eslintrc.json", 4 | ".gitattributes", 5 | ".gitignore", 6 | ".prettierignore", 7 | ".prettierrc.json", 8 | ".projen/deps.json", 9 | ".projen/files.json", 10 | ".projen/tasks.json", 11 | "LICENSE", 12 | "project.json", 13 | "tsconfig.dev.json", 14 | "tsconfig.json" 15 | ], 16 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 17 | } 18 | -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/README.md: -------------------------------------------------------------------------------- 1 | # replace this -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/src/index.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | export * from './interceptors'; 4 | export * from './utils'; 5 | -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | export * from './api-response'; 4 | export * from './uuid'; 5 | export * from './cognito-auth'; 6 | -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/src/utils/uuid.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import { randomUUID } from 'crypto'; 4 | import { customAlphabet } from 'nanoid'; 5 | 6 | /** 7 | * Generates a unique UUID for a resource prefixed by the given string 8 | */ 9 | export const generateUUID = (prefix?: string) => { 10 | const id = randomUUID(); 11 | if (prefix) { 12 | return `${prefix}-${id}`; 13 | } 14 | return id; 15 | }; 16 | 17 | /** 18 | * Generates a unique nanoid for a resource prefixed by the given string. 19 | * Only uses `0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz` for alphabet. 20 | */ 21 | export const generateUniqueId = (prefix?: string, size: number = 10) => { 22 | const id = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', size)(); 23 | if (prefix) { 24 | return `${prefix}-${id}`; 25 | } 26 | return id; 27 | }; 28 | -------------------------------------------------------------------------------- /demo/api/interceptors/typescript/tsconfig.json: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | { 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | "alwaysStrict": true, 7 | "declaration": true, 8 | "esModuleInterop": true, 9 | "experimentalDecorators": true, 10 | "inlineSourceMap": true, 11 | "inlineSources": true, 12 | "lib": [ 13 | "dom", 14 | "ES2019" 15 | ], 16 | "module": "CommonJS", 17 | "noEmitOnError": false, 18 | "noFallthroughCasesInSwitch": true, 19 | "noImplicitAny": true, 20 | "noImplicitReturns": true, 21 | "noImplicitThis": true, 22 | "noUnusedLocals": true, 23 | "noUnusedParameters": true, 24 | "resolveJsonModule": true, 25 | "strict": true, 26 | "strictNullChecks": true, 27 | "strictPropertyInitialization": true, 28 | "stripInternal": true, 29 | "target": "ES2019", 30 | "skipLibCheck": true 31 | }, 32 | "include": [ 33 | "src/**/*.ts" 34 | ], 35 | "exclude": [] 36 | } 37 | -------------------------------------------------------------------------------- /demo/api/model/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | node_modules/ 3 | !/.gitattributes 4 | !/.projen/tasks.json 5 | !/.projen/deps.json 6 | !/.projen/files.json 7 | gradle 8 | gradlew 9 | gradlew.bat 10 | .gradle 11 | !/settings.gradle 12 | !/build.gradle 13 | !/smithy-build.json 14 | !/generated/main/smithy/aws-pdk/prelude.smithy 15 | build 16 | smithy-output 17 | .api.json 18 | !/project.json 19 | !/LICENSE 20 | -------------------------------------------------------------------------------- /demo/api/model/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".gitattributes", 4 | ".gitignore", 5 | ".projen/deps.json", 6 | ".projen/files.json", 7 | ".projen/tasks.json", 8 | "build.gradle", 9 | "generated/main/smithy/aws-pdk/prelude.smithy", 10 | "LICENSE", 11 | "project.json", 12 | "settings.gradle", 13 | "smithy-build.json" 14 | ], 15 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 16 | } 17 | -------------------------------------------------------------------------------- /demo/api/model/build.gradle: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | plugins { 3 | id "software.amazon.smithy" version "0.6.0" 4 | } 5 | 6 | sourceSets { 7 | main { 8 | java { 9 | srcDirs = ['src/main/smithy', 'generated/main/smithy'] 10 | } 11 | } 12 | } 13 | 14 | // Dependencies can be added by configuring smithyBuildOptions in your .projenrc file 15 | repositories { 16 | mavenLocal() 17 | mavenCentral() 18 | } 19 | 20 | // Dependencies can be added by configuring smithyBuildOptions in your .projenrc file 21 | dependencies { 22 | implementation "software.amazon.smithy:smithy-cli:1.28.0" 23 | implementation "software.amazon.smithy:smithy-model:1.28.0" 24 | implementation "software.amazon.smithy:smithy-openapi:1.28.0" 25 | implementation "software.amazon.smithy:smithy-aws-traits:1.28.0" 26 | } 27 | -------------------------------------------------------------------------------- /demo/api/model/settings.gradle: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | rootProject.name = 'api-model' 3 | -------------------------------------------------------------------------------- /demo/api/model/smithy-build.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "projections": { 4 | "openapi": { 5 | "plugins": { 6 | "openapi": { 7 | "service": "com.amazon#MyApi", 8 | "tags": true, 9 | "useIntegerType": true 10 | } 11 | } 12 | } 13 | }, 14 | "maven": { 15 | "dependencies": [ 16 | "software.amazon.smithy:smithy-cli:1.28.0", 17 | "software.amazon.smithy:smithy-model:1.28.0", 18 | "software.amazon.smithy:smithy-openapi:1.28.0", 19 | "software.amazon.smithy:smithy-aws-traits:1.28.0" 20 | ], 21 | "repositories": [ 22 | { 23 | "url": "https://repo.maven.apache.org/maven2/" 24 | }, 25 | { 26 | "url": "file://~/.m2/repository" 27 | } 28 | ] 29 | }, 30 | "sources": [ 31 | "src/main/smithy", 32 | "generated/main/smithy" 33 | ], 34 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 35 | } -------------------------------------------------------------------------------- /demo/api/model/src/main/smithy/chat/service.smithy: -------------------------------------------------------------------------------- 1 | $version: "2" 2 | 3 | namespace com.amazon 4 | 5 | use aws.protocols#restJson1 6 | 7 | @mixin 8 | @restJson1 9 | service ChatService { 10 | version: "1.0" 11 | resources: [ 12 | ChatResource 13 | ChatMessageResource 14 | ChatMessageSourceResource 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /demo/api/model/src/main/smithy/llm/service.smithy: -------------------------------------------------------------------------------- 1 | $version: "2" 2 | 3 | namespace com.amazon 4 | 5 | use aws.protocols#restJson1 6 | 7 | @mixin 8 | @restJson1 9 | service LLMService { 10 | version: "1.0" 11 | operations: [ 12 | LLMInventory 13 | ] 14 | } 15 | 16 | 17 | @readonly 18 | @http(method: "GET", uri: "/llm/inventory") 19 | operation LLMInventory { 20 | input:= {} 21 | output:= { 22 | @required 23 | inventory: Any 24 | // TODO: using any for now but should update schema based on actual inventory spec 25 | } 26 | errors: [ServerError, ClientError] 27 | } 28 | -------------------------------------------------------------------------------- /demo/api/model/src/main/smithy/main.smithy: -------------------------------------------------------------------------------- 1 | $version: "2" 2 | 3 | namespace com.amazon 4 | 5 | use aws.protocols#restJson1 6 | /// A sample smithy api 7 | 8 | @restJson1 9 | service MyApi with [ 10 | ChatService 11 | CorpusService 12 | LLMService 13 | ]{ 14 | version: "1.0" 15 | operations: [] 16 | errors: [ 17 | ServerError 18 | NotAuthorizedError 19 | ClientError 20 | ServerTemporaryError 21 | NotFoundError 22 | ] 23 | } 24 | 25 | string CognitoAuthenticationProvider 26 | -------------------------------------------------------------------------------- /demo/corpus/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | node_modules/ 3 | !/.gitattributes 4 | !/.projen/tasks.json 5 | !/.projen/deps.json 6 | !/.projen/files.json 7 | !/project.json 8 | !/LICENSE 9 | -------------------------------------------------------------------------------- /demo/corpus/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".gitattributes", 4 | ".gitignore", 5 | ".projen/deps.json", 6 | ".projen/files.json", 7 | ".projen/tasks.json", 8 | "LICENSE", 9 | "project.json" 10 | ], 11 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 12 | } 13 | -------------------------------------------------------------------------------- /demo/corpus/docker-scripts/entry_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | 5 | 6 | echo "Entry Script: $@" 7 | 8 | TARGET="$1" 9 | shift 10 | 11 | if [ "${TARGET}" == "lambda" ]; then 12 | echo "Run lambda entry script" 13 | exec /lambda_entry_script.sh $@ 14 | elif [ "${TARGET}" == "sagemaker" ]; then 15 | echo "Run sagemaker entry script" 16 | exec /sagemaker_entry_script.sh $@ 17 | else 18 | echo "entrypoint requires the corpus command to be the first argument" 1>&2 19 | exit 444 20 | fi 21 | -------------------------------------------------------------------------------- /demo/corpus/docker-scripts/lambda_entry_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | 5 | cd ${FUNCTION_DIR}/logic 6 | 7 | _HANDLER="${1:-api.handler}" 8 | shift 9 | 10 | if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then 11 | exec /usr/local/bin/aws-lambda-rie $(which npx) --no-install aws-lambda-ric ${_HANDLER} 12 | else 13 | exec $(which npx) --no-install aws-lambda-ric ${_HANDLER} 14 | fi 15 | -------------------------------------------------------------------------------- /demo/corpus/docker-scripts/sagemaker_entry_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | 5 | cd ${FUNCTION_DIR}/logic 6 | 7 | _HANDLER="${1:-indexing.js}" 8 | shift 9 | 10 | AWS_LAMBDA_FUNCTION_MEMORY_SIZE=${AWS_LAMBDA_FUNCTION_MEMORY_SIZE:-1024} 11 | 12 | if [ -n "$AWS_LAMBDA_FUNCTION_MEMORY_SIZE" ]; then 13 | new_space=$(expr $AWS_LAMBDA_FUNCTION_MEMORY_SIZE / 10) 14 | semi_space=$(expr $new_space / 2) 15 | old_space=$(expr $AWS_LAMBDA_FUNCTION_MEMORY_SIZE - $new_space) 16 | MEMORY_ARGS=( 17 | "--max-semi-space-size=$semi_space" 18 | "--max-old-space-size=$old_space" 19 | ) 20 | fi 21 | 22 | NODE_ARGS=( 23 | --expose-gc 24 | --max-http-header-size 81920 25 | --enable-source-maps 26 | "${MEMORY_ARGS[@]}" 27 | ${_HANDLER} 28 | ) 29 | 30 | # Run indexing 31 | exec $(which node) "${NODE_ARGS[@]}" 32 | -------------------------------------------------------------------------------- /demo/corpus/logic/.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | /.eslintrc.json linguist-generated 4 | /.gitattributes linguist-generated 5 | /.gitignore linguist-generated 6 | /.npmignore linguist-generated 7 | /.npmrc linguist-generated 8 | /.prettierignore linguist-generated 9 | /.prettierrc.json linguist-generated 10 | /.projen/** linguist-generated 11 | /.projen/deps.json linguist-generated 12 | /.projen/files.json linguist-generated 13 | /.projen/tasks.json linguist-generated 14 | /LICENSE linguist-generated 15 | /package.json linguist-generated 16 | /pnpm-lock.yaml linguist-generated 17 | /project.json linguist-generated 18 | /tsconfig.dev.json linguist-generated 19 | /tsconfig.json linguist-generated -------------------------------------------------------------------------------- /demo/corpus/logic/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | !/.gitattributes 3 | !/.projen/tasks.json 4 | !/.projen/deps.json 5 | !/.projen/files.json 6 | !/package.json 7 | !/LICENSE 8 | !/.npmignore 9 | logs 10 | *.log 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | lerna-debug.log* 15 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 16 | pids 17 | *.pid 18 | *.seed 19 | *.pid.lock 20 | lib-cov 21 | coverage 22 | *.lcov 23 | .nyc_output 24 | build/Release 25 | node_modules/ 26 | jspm_packages/ 27 | *.tsbuildinfo 28 | .eslintcache 29 | *.tgz 30 | .yarn-integrity 31 | .cache 32 | /test-reports/ 33 | junit.xml 34 | /coverage/ 35 | !/.prettierignore 36 | !/.prettierrc.json 37 | !/.npmrc 38 | !/test/ 39 | !/tsconfig.json 40 | !/tsconfig.dev.json 41 | !/src/ 42 | /lib 43 | /dist/ 44 | !/.eslintrc.json 45 | .docker-dist 46 | !/project.json 47 | -------------------------------------------------------------------------------- /demo/corpus/logic/.npmignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | /.projen/ 3 | /test-reports/ 4 | junit.xml 5 | /coverage/ 6 | /.prettierignore 7 | /.prettierrc.json 8 | /test/ 9 | /tsconfig.dev.json 10 | /src/ 11 | !/lib/ 12 | !/lib/**/*.js 13 | !/lib/**/*.d.ts 14 | dist 15 | /tsconfig.json 16 | /.github/ 17 | /.vscode/ 18 | /.idea/ 19 | /.projenrc.js 20 | tsconfig.tsbuildinfo 21 | /.eslintrc.json 22 | /.gitattributes 23 | -------------------------------------------------------------------------------- /demo/corpus/logic/.npmrc: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | resolution-mode=highest 4 | -------------------------------------------------------------------------------- /demo/corpus/logic/.prettierignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | -------------------------------------------------------------------------------- /demo/corpus/logic/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [ 3 | { 4 | "files": [ 5 | "**/*.ts", 6 | "**/*.tsx" 7 | ], 8 | "options": { 9 | "trailingComma": "all", 10 | "singleQuote": true, 11 | "printWidth": 120 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /demo/corpus/logic/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".eslintrc.json", 4 | ".gitattributes", 5 | ".gitignore", 6 | ".npmignore", 7 | ".npmrc", 8 | ".prettierignore", 9 | ".prettierrc.json", 10 | ".projen/deps.json", 11 | ".projen/files.json", 12 | ".projen/tasks.json", 13 | "LICENSE", 14 | "project.json", 15 | "tsconfig.dev.json", 16 | "tsconfig.json" 17 | ], 18 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 19 | } 20 | -------------------------------------------------------------------------------- /demo/corpus/logic/README.md: -------------------------------------------------------------------------------- 1 | # replace this -------------------------------------------------------------------------------- /demo/corpus/logic/src/api/index.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | export * from './router'; 4 | export * from './handlers'; 5 | -------------------------------------------------------------------------------- /demo/corpus/logic/src/indexing/utils.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import glob from 'fast-glob'; 4 | 5 | /** 6 | * Break array into number of equal sized arrays, except last chunk might be less. 7 | */ 8 | export function chunkArray(items: T[], count: number): T[][] { 9 | const chunks: T[][] = []; 10 | for (let i = 0; i < items.length; i += count) { 11 | chunks.push(items.slice(i, i + count)); 12 | } 13 | return chunks; 14 | } 15 | 16 | /** 17 | * Break array into multiple arrays each containing at most x items. 18 | */ 19 | export function shardArray(items: T[], count: number): T[][] { 20 | if (items.length === 0) return []; 21 | return chunkArray(items, Math.ceil(items.length / count)); 22 | } 23 | 24 | export async function globDir(dir: string, pattern: string): Promise { 25 | const globPatterns = pattern.split(','); 26 | 27 | return glob(globPatterns, { cwd: dir }); 28 | } 29 | -------------------------------------------------------------------------------- /demo/corpus/logic/src/indexing/vectorstore.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import { VectorStore } from '@langchain/core/vectorstores'; 4 | import { getEmbeddingsByModelId } from '../embedding/util'; 5 | import { vectorStoreFactory } from '../vectorstore'; 6 | 7 | export async function resolveVectorStore( 8 | embeddingTableName: string, 9 | embeddingModelId: string, 10 | vectorSize: number, 11 | ): Promise { 12 | const embeddings = getEmbeddingsByModelId(embeddingModelId, { maxConcurrency: 10 }); 13 | const vectorStore = await vectorStoreFactory({ 14 | embeddingTableName, 15 | embeddings, 16 | vectorSize, 17 | }); 18 | // TODO: support passing vector store config 19 | return vectorStore; 20 | } 21 | -------------------------------------------------------------------------------- /demo/corpus/logic/src/metrics.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import { createMetrics } from '@aws/galileo-sdk/lib/common/metrics'; 4 | 5 | export { measurable, measure, startPerfMetric as measurer } from '@aws/galileo-sdk/lib/common/metrics'; 6 | 7 | const [metrics, logMetric] = createMetrics({ 8 | serviceName: 'Corpus', 9 | }); 10 | 11 | export { metrics, logMetric }; 12 | -------------------------------------------------------------------------------- /demo/corpus/logic/tsconfig.dev.json: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | { 3 | "compilerOptions": { 4 | "alwaysStrict": true, 5 | "declaration": true, 6 | "esModuleInterop": true, 7 | "experimentalDecorators": true, 8 | "inlineSourceMap": true, 9 | "inlineSources": true, 10 | "lib": [ 11 | "es2019" 12 | ], 13 | "module": "CommonJS", 14 | "noEmitOnError": false, 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "noUnusedLocals": false, 20 | "noUnusedParameters": false, 21 | "resolveJsonModule": true, 22 | "strict": true, 23 | "strictNullChecks": true, 24 | "strictPropertyInitialization": true, 25 | "stripInternal": true, 26 | "target": "ES2019", 27 | "skipLibCheck": true 28 | }, 29 | "include": [ 30 | "src/**/*.ts", 31 | "test/**/*.ts" 32 | ], 33 | "exclude": [ 34 | "node_modules" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /demo/corpus/logic/tsconfig.json: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | { 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | "alwaysStrict": true, 7 | "declaration": true, 8 | "esModuleInterop": true, 9 | "experimentalDecorators": true, 10 | "inlineSourceMap": true, 11 | "inlineSources": true, 12 | "lib": [ 13 | "es2019" 14 | ], 15 | "module": "CommonJS", 16 | "noEmitOnError": false, 17 | "noFallthroughCasesInSwitch": true, 18 | "noImplicitAny": true, 19 | "noImplicitReturns": true, 20 | "noImplicitThis": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "resolveJsonModule": true, 24 | "strict": true, 25 | "strictNullChecks": true, 26 | "strictPropertyInitialization": true, 27 | "stripInternal": true, 28 | "target": "ES2019", 29 | "skipLibCheck": true 30 | }, 31 | "include": [ 32 | "src/**/*.ts" 33 | ], 34 | "exclude": [] 35 | } 36 | -------------------------------------------------------------------------------- /demo/corpus/test/events/emdedding/embed-documents.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "routeKey": "$default", 4 | "rawPath": "/corpus/embedding/embed-documents", 5 | "rawQueryString": "", 6 | "headers": {}, 7 | "cookies": {}, 8 | "queryStringParameters": {}, 9 | "requestContext": { 10 | "domainName": "localhost", 11 | "http": { 12 | "method": "POST", 13 | "path": "/corpus/embedding/embed-documents", 14 | "protocol": "HTTP/1.1" 15 | } 16 | }, 17 | "body": "{\"texts\": [\"document 1\", \"document-2\"]}", 18 | "pathParameters": null, 19 | "isBase64Encoding": false, 20 | "stageVariables": null 21 | } 22 | -------------------------------------------------------------------------------- /demo/corpus/test/events/emdedding/embed-query.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "routeKey": "$default", 4 | "rawPath": "/corpus/embedding/embed-query", 5 | "rawQueryString": "", 6 | "headers": {}, 7 | "cookies": {}, 8 | "queryStringParameters": {}, 9 | "requestContext": { 10 | "domainName": "localhost", 11 | "http": { 12 | "method": "POST", 13 | "path": "/corpus/embedding/embed-query", 14 | "protocol": "HTTP/1.1" 15 | } 16 | }, 17 | "body": "{\"text\": \"example query\"}", 18 | "pathParameters": null, 19 | "isBase64Encoding": false, 20 | "stageVariables": null 21 | } 22 | -------------------------------------------------------------------------------- /demo/corpus/test/events/emdedding/similarity-search.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "routeKey": "$default", 4 | "rawPath": "/corpus/search/similarity", 5 | "rawQueryString": "", 6 | "headers": {}, 7 | "cookies": {}, 8 | "queryStringParameters": {}, 9 | "requestContext": { 10 | "domainName": "localhost", 11 | "http": { 12 | "method": "POST", 13 | "path": "/corpus/search/similarity", 14 | "protocol": "HTTP/1.1" 15 | } 16 | }, 17 | "body": "{\"query\": \"Example query\", \"k\": 3}", 18 | "pathParameters": null, 19 | "isBase64Encoding": false, 20 | "stageVariables": null 21 | } 22 | -------------------------------------------------------------------------------- /demo/infra/.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | /.eslintrc.json linguist-generated 4 | /.gitattributes linguist-generated 5 | /.gitignore linguist-generated 6 | /.npmrc linguist-generated 7 | /.prettierignore linguist-generated 8 | /.prettierrc.json linguist-generated 9 | /.projen/** linguist-generated 10 | /.projen/deps.json linguist-generated 11 | /.projen/files.json linguist-generated 12 | /.projen/tasks.json linguist-generated 13 | /cdk.json linguist-generated 14 | /LICENSE linguist-generated 15 | /package.json linguist-generated 16 | /pnpm-lock.yaml linguist-generated 17 | /project.json linguist-generated 18 | /tsconfig.dev.json linguist-generated 19 | /tsconfig.json linguist-generated -------------------------------------------------------------------------------- /demo/infra/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | !/.gitattributes 3 | !/.projen/tasks.json 4 | !/.projen/deps.json 5 | !/.projen/files.json 6 | !/package.json 7 | !/LICENSE 8 | logs 9 | *.log 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | lerna-debug.log* 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | lib-cov 20 | coverage 21 | *.lcov 22 | .nyc_output 23 | build/Release 24 | node_modules/ 25 | jspm_packages/ 26 | *.tsbuildinfo 27 | .eslintcache 28 | *.tgz 29 | .yarn-integrity 30 | .cache 31 | /test-reports/ 32 | junit.xml 33 | /coverage/ 34 | !/.prettierignore 35 | !/.prettierrc.json 36 | !/.npmrc 37 | !/test/ 38 | !/tsconfig.json 39 | !/tsconfig.dev.json 40 | !/src/ 41 | /lib 42 | /dist/ 43 | !/.eslintrc.json 44 | /assets/ 45 | !/cdk.json 46 | /cdk.out/ 47 | .cdk.staging/ 48 | .parcel-cache/ 49 | config*.json 50 | cdk.context.json 51 | !/project.json 52 | -------------------------------------------------------------------------------- /demo/infra/.prettierignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | -------------------------------------------------------------------------------- /demo/infra/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [ 3 | { 4 | "files": [ 5 | "**/*.ts", 6 | "**/*.tsx" 7 | ], 8 | "options": { 9 | "trailingComma": "all", 10 | "singleQuote": true, 11 | "printWidth": 120 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /demo/infra/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".eslintrc.json", 4 | ".gitattributes", 5 | ".gitignore", 6 | ".prettierignore", 7 | ".prettierrc.json", 8 | ".projen/deps.json", 9 | ".projen/files.json", 10 | ".projen/tasks.json", 11 | "cdk.json", 12 | "LICENSE", 13 | "project.json", 14 | "tsconfig.dev.json", 15 | "tsconfig.json" 16 | ], 17 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 18 | } 19 | -------------------------------------------------------------------------------- /demo/infra/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "npx ts-node -P tsconfig.json --prefer-ts-exts src/main.ts", 3 | "context": { 4 | "@aws-cdk/aws-lambda:recognizeLayerVersion": true, 5 | "repositoryName": "galileo", 6 | "@aws-galileo/EULA/ENABLED": false, 7 | "websiteContentPath": "../website/build", 8 | "corpusDockerImagePath": "../corpus" 9 | }, 10 | "output": "cdk.out", 11 | "build": "npx projen bundle", 12 | "watch": { 13 | "include": [ 14 | "src/**/*.ts", 15 | "test/**/*.ts" 16 | ], 17 | "exclude": [ 18 | "README.md", 19 | "cdk*.json", 20 | "**/*.d.ts", 21 | "**/*.js", 22 | "tsconfig.json", 23 | "package*.json", 24 | "yarn.lock", 25 | "node_modules" 26 | ] 27 | }, 28 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 29 | } 30 | -------------------------------------------------------------------------------- /demo/infra/src/application/ai/foundation-models/index.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | export * from './stack'; 4 | -------------------------------------------------------------------------------- /demo/infra/src/application/ai/inference-engine/engine/handler/.gitignore: -------------------------------------------------------------------------------- 1 | # do not commit chat setting json files 2 | *.json 3 | -------------------------------------------------------------------------------- /demo/infra/src/application/ai/inference-engine/engine/handler/shared/types.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | 4 | import { ChatEngineConfig as RestChatEngineConfig } from 'api-typescript-runtime'; 5 | import { ChatEngineConfig as WsChatEngineConfig } from 'ws-api-typescript-runtime'; 6 | import { ENV } from './env'; 7 | 8 | export type ChatEngineConfig = RestChatEngineConfig | WsChatEngineConfig; 9 | 10 | const ADMIN_GROUPS: string[] = JSON.parse(ENV.ADMIN_GROUPS); 11 | export function isAdmin(groups?: string[]): boolean { 12 | return groups != null && groups.filter((v) => ADMIN_GROUPS.includes(v)).length > 0; 13 | } 14 | -------------------------------------------------------------------------------- /demo/infra/src/application/ai/inference-engine/index.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | export * from './stack'; 4 | export * from './engine'; 5 | -------------------------------------------------------------------------------- /demo/infra/src/application/ai/inference-engine/stack.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import { Construct } from 'constructs'; 4 | import { InferenceEngine, InferenceEngineProps } from './engine'; 5 | import { MonitoredNestedStack, MonitoredNestedStackProps } from '../../monitoring'; 6 | 7 | export interface InferenceEngineStackProps extends InferenceEngineProps, MonitoredNestedStackProps {} 8 | 9 | export class InferenceEngineStack extends MonitoredNestedStack { 10 | readonly engine: InferenceEngine; 11 | 12 | constructor(scope: Construct, id: string, props: InferenceEngineStackProps) { 13 | super(scope, id, props); 14 | 15 | this.engine = new InferenceEngine(this, 'Engine', props); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /demo/infra/src/application/corpus/pipeline/handlers/task/vectorstore/create-indexes/handler.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import { Logger } from '@aws-lambda-powertools/logger'; 4 | import { ENV } from 'corpus-logic/lib/env'; 5 | import { indexVectorStore } from 'corpus-logic/lib/vectorstore/management'; 6 | import { State } from '../../../../types'; 7 | 8 | const logger = new Logger(); 9 | 10 | async function main(event: State): Promise { 11 | logger.info({ message: 'corpus-logic env', env: ENV }); 12 | 13 | logger.info('Indexing vector store...'); 14 | await indexVectorStore(event.Environment.EMBEDDING_TABLENAME, event.Environment.EMBEDDING_MODEL_VECTOR_SIZE); 15 | logger.info('Vector store successfully indexed'); 16 | } 17 | 18 | (async () => { 19 | await main(); 20 | })().catch(console.error); 21 | -------------------------------------------------------------------------------- /demo/infra/src/application/corpus/pipeline/handlers/task/vectorstore/create-indexes/image/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.map 3 | -------------------------------------------------------------------------------- /demo/infra/src/application/corpus/pipeline/handlers/task/vectorstore/create-indexes/image/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-slim 2 | WORKDIR /app 3 | COPY . . 4 | CMD ["node", "index.js"] 5 | -------------------------------------------------------------------------------- /demo/infra/src/application/data/index.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | export * from './app-data-layer'; 4 | -------------------------------------------------------------------------------- /demo/infra/src/application/index.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | export * from './stack'; 4 | export * from './stage'; 5 | -------------------------------------------------------------------------------- /demo/infra/src/application/networking/stack.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import { Stack, StackProps } from 'aws-cdk-lib'; 4 | import { IVpc } from 'aws-cdk-lib/aws-ec2'; 5 | import { IConstruct } from 'constructs'; 6 | import { NetworkingLayer } from './layer'; 7 | 8 | export interface NetworkingStackProps extends StackProps {} 9 | 10 | export class NetworkingStack extends Stack { 11 | readonly layer: NetworkingLayer; 12 | 13 | get vpc(): IVpc { 14 | return this.layer.vpc; 15 | } 16 | 17 | constructor(scope: IConstruct, id: string, props?: NetworkingStackProps) { 18 | super(scope, id, props); 19 | 20 | this.layer = new NetworkingLayer(this, 'Layer'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /demo/infra/src/application/presentation/lambdas/llm/inventory.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import { FoundationModelInventory } from '@aws/galileo-sdk/lib/models/inventory'; 4 | import { interceptors } from 'api-typescript-interceptors'; 5 | import { lLMInventoryHandler } from 'api-typescript-runtime'; 6 | 7 | export const handler = lLMInventoryHandler(...interceptors, async () => { 8 | const inventory = await FoundationModelInventory.inventory(); 9 | 10 | return { 11 | statusCode: 200, 12 | body: { 13 | inventory, 14 | }, 15 | }; 16 | }); 17 | -------------------------------------------------------------------------------- /demo/infra/src/application/tags.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | 4 | import { TagProps, Tags } from 'aws-cdk-lib'; 5 | import { Construct } from 'constructs'; 6 | 7 | /** 8 | * Tags used to identify core components in the application. 9 | * Used for filtering resource lists of dynamically name resourced. 10 | */ 11 | export enum GalileoComponentTags { 12 | CORPUS_INDEXING_BUCKET = 'CorpusIndexingBucket', 13 | CORPUS_INDEXING_STATEMACHINE = 'CorpusIndexingStateMachine', 14 | } 15 | 16 | export const APPLICATION_COMPONENT_TAG = 'ApplicationComponent'; 17 | 18 | export function tagAsComponent(component: GalileoComponentTags, resource: Construct, props?: TagProps): void { 19 | Tags.of(resource).add(APPLICATION_COMPONENT_TAG, component, props); 20 | } 21 | -------------------------------------------------------------------------------- /demo/infra/test/main.test.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | 4 | // import { App } from "aws-cdk-lib"; 5 | // import { Template } from "aws-cdk-lib/assertions"; 6 | // import { ApplicationStack } from "../src/stacks/application-stack"; 7 | 8 | // test("Snapshot", () => { 9 | // const app = new App(); 10 | // const stack = new ApplicationStack(app, "test"); 11 | 12 | // const template = Template.fromStack(stack); 13 | // expect(template.toJSON()).toMatchSnapshot(); 14 | // }); 15 | 16 | test('passthrough', () => { 17 | expect(true).toBe(true); 18 | }); 19 | -------------------------------------------------------------------------------- /demo/overrides/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !*.md 4 | -------------------------------------------------------------------------------- /demo/sample-dataset/.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | /.eslintrc.json linguist-generated 4 | /.gitattributes linguist-generated 5 | /.gitignore linguist-generated 6 | /.npmignore linguist-generated 7 | /.npmrc linguist-generated 8 | /.prettierignore linguist-generated 9 | /.prettierrc.json linguist-generated 10 | /.projen/** linguist-generated 11 | /.projen/deps.json linguist-generated 12 | /.projen/files.json linguist-generated 13 | /.projen/tasks.json linguist-generated 14 | /LICENSE linguist-generated 15 | /package.json linguist-generated 16 | /pnpm-lock.yaml linguist-generated 17 | /project.json linguist-generated 18 | /tsconfig.dev.json linguist-generated 19 | /tsconfig.json linguist-generated -------------------------------------------------------------------------------- /demo/sample-dataset/.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | !/.gitattributes 3 | !/.projen/tasks.json 4 | !/.projen/deps.json 5 | !/.projen/files.json 6 | !/package.json 7 | !/LICENSE 8 | !/.npmignore 9 | logs 10 | *.log 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | lerna-debug.log* 15 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 16 | pids 17 | *.pid 18 | *.seed 19 | *.pid.lock 20 | lib-cov 21 | coverage 22 | *.lcov 23 | .nyc_output 24 | build/Release 25 | node_modules/ 26 | jspm_packages/ 27 | *.tsbuildinfo 28 | .eslintcache 29 | *.tgz 30 | .yarn-integrity 31 | .cache 32 | /test-reports/ 33 | junit.xml 34 | /coverage/ 35 | !/.prettierignore 36 | !/.prettierrc.json 37 | !/.npmrc 38 | !/test/ 39 | !/tsconfig.json 40 | !/tsconfig.dev.json 41 | !/src/ 42 | /lib 43 | /dist/ 44 | !/.eslintrc.json 45 | generated 46 | !/project.json 47 | -------------------------------------------------------------------------------- /demo/sample-dataset/.npmignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | /.projen/ 3 | /test-reports/ 4 | junit.xml 5 | /coverage/ 6 | /.prettierignore 7 | /.prettierrc.json 8 | /test/ 9 | /tsconfig.dev.json 10 | /src/ 11 | !/lib/ 12 | !/lib/**/*.js 13 | !/lib/**/*.d.ts 14 | dist 15 | /tsconfig.json 16 | /.github/ 17 | /.vscode/ 18 | /.idea/ 19 | /.projenrc.js 20 | tsconfig.tsbuildinfo 21 | /.eslintrc.json 22 | /.gitattributes 23 | -------------------------------------------------------------------------------- /demo/sample-dataset/.prettierignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | -------------------------------------------------------------------------------- /demo/sample-dataset/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [ 3 | { 4 | "files": [ 5 | "**/*.ts", 6 | "**/*.tsx" 7 | ], 8 | "options": { 9 | "trailingComma": "all", 10 | "singleQuote": true, 11 | "printWidth": 120 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /demo/sample-dataset/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".eslintrc.json", 4 | ".gitattributes", 5 | ".gitignore", 6 | ".npmignore", 7 | ".prettierignore", 8 | ".prettierrc.json", 9 | ".projen/deps.json", 10 | ".projen/files.json", 11 | ".projen/tasks.json", 12 | "LICENSE", 13 | "project.json", 14 | "tsconfig.dev.json", 15 | "tsconfig.json" 16 | ], 17 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 18 | } 19 | -------------------------------------------------------------------------------- /demo/sample-dataset/README.md: -------------------------------------------------------------------------------- 1 | # replace this -------------------------------------------------------------------------------- /demo/sample-dataset/scripts/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | -------------------------------------------------------------------------------- /demo/sample-dataset/test/index.test.ts: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import { SampleDatasetStack } from '../src'; 4 | 5 | test('SampleDatasetStack', () => { 6 | expect(SampleDatasetStack).toBeDefined(); 7 | }); 8 | -------------------------------------------------------------------------------- /demo/sample-dataset/tsconfig.dev.json: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | { 3 | "compilerOptions": { 4 | "alwaysStrict": true, 5 | "declaration": true, 6 | "esModuleInterop": true, 7 | "experimentalDecorators": true, 8 | "inlineSourceMap": true, 9 | "inlineSources": true, 10 | "lib": [ 11 | "es2019" 12 | ], 13 | "module": "CommonJS", 14 | "noEmitOnError": false, 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "resolveJsonModule": true, 22 | "strict": true, 23 | "strictNullChecks": true, 24 | "strictPropertyInitialization": true, 25 | "stripInternal": true, 26 | "target": "ES2019" 27 | }, 28 | "include": [ 29 | "src/**/*.ts", 30 | "test/**/*.ts" 31 | ], 32 | "exclude": [ 33 | "node_modules" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /demo/sample-dataset/tsconfig.json: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | { 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | "alwaysStrict": true, 7 | "declaration": true, 8 | "esModuleInterop": true, 9 | "experimentalDecorators": true, 10 | "inlineSourceMap": true, 11 | "inlineSources": true, 12 | "lib": [ 13 | "es2019" 14 | ], 15 | "module": "CommonJS", 16 | "noEmitOnError": false, 17 | "noFallthroughCasesInSwitch": true, 18 | "noImplicitAny": true, 19 | "noImplicitReturns": true, 20 | "noImplicitThis": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "resolveJsonModule": true, 24 | "strict": true, 25 | "strictNullChecks": true, 26 | "strictPropertyInitialization": true, 27 | "stripInternal": true, 28 | "target": "ES2019" 29 | }, 30 | "include": [ 31 | "src/**/*.ts" 32 | ], 33 | "exclude": [] 34 | } 35 | -------------------------------------------------------------------------------- /demo/website/.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | /.eslintrc.json linguist-generated 4 | /.gitattributes linguist-generated 5 | /.gitignore linguist-generated 6 | /.npmrc linguist-generated 7 | /.prettierignore linguist-generated 8 | /.prettierrc.json linguist-generated 9 | /.projen/** linguist-generated 10 | /.projen/deps.json linguist-generated 11 | /.projen/files.json linguist-generated 12 | /.projen/react-config-overrides.js linguist-generated 13 | /.projen/tasks.json linguist-generated 14 | /.storybook/main.ts linguist-generated 15 | /.storybook/preview.ts linguist-generated 16 | /LICENSE linguist-generated 17 | /package.json linguist-generated 18 | /pnpm-lock.yaml linguist-generated 19 | /project.json linguist-generated 20 | /tsconfig.dev.json linguist-generated 21 | /tsconfig.json linguist-generated -------------------------------------------------------------------------------- /demo/website/.prettierignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | .projen/react-config-overrides.js 3 | -------------------------------------------------------------------------------- /demo/website/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [ 3 | { 4 | "files": [ 5 | "**/*.ts", 6 | "**/*.tsx" 7 | ], 8 | "options": { 9 | "trailingComma": "all", 10 | "singleQuote": true, 11 | "printWidth": 120 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /demo/website/.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".eslintrc.json", 4 | ".gitattributes", 5 | ".gitignore", 6 | ".prettierignore", 7 | ".prettierrc.json", 8 | ".projen/deps.json", 9 | ".projen/files.json", 10 | ".projen/react-config-overrides.js", 11 | ".projen/tasks.json", 12 | ".storybook/main.ts", 13 | ".storybook/preview.ts", 14 | "LICENSE", 15 | "project.json", 16 | "tsconfig.dev.json", 17 | "tsconfig.json" 18 | ], 19 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 20 | } 21 | -------------------------------------------------------------------------------- /demo/website/.projen/react-config-overrides.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Override CRA configuration without needing to eject. 3 | * 4 | * @see https://www.npmjs.com/package/react-app-rewired 5 | */ 6 | module.exports = function override(config, env) { 7 | return require('../webpack/config-overrides')(config, env); 8 | }; -------------------------------------------------------------------------------- /demo/website/.storybook/__mocks__/api-typescript-react-query-hooks.ts: -------------------------------------------------------------------------------- 1 | import { CreateChatRequest } from "api-typescript-react-query-hooks"; 2 | 3 | export function useCreateChat() { 4 | return { 5 | mutateAsync: () => {}, 6 | }; 7 | } 8 | 9 | export function useCreateChatMessage() { 10 | return { 11 | mutateAsync: () => {}, 12 | }; 13 | } 14 | 15 | export function useUpdateChat() { 16 | return { 17 | mutateAsync: () => {}, 18 | }; 19 | } 20 | 21 | export function useListChatMessages() { 22 | return { 23 | data: [], 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /demo/website/.storybook/main.ts: -------------------------------------------------------------------------------- 1 | 2 | import type { StorybookConfig } from "@storybook/react-webpack5"; 3 | const config: StorybookConfig = { 4 | stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], 5 | addons: [ 6 | "@storybook/addon-links", 7 | "@storybook/addon-essentials", 8 | "@storybook/preset-create-react-app", 9 | "@storybook/addon-interactions", 10 | ], 11 | framework: { 12 | name: "@storybook/react-webpack5", 13 | options: {}, 14 | }, 15 | docs: { 16 | autodocs: "tag", 17 | }, 18 | core:{ 19 | disableTelemetry: true, 20 | }, 21 | staticDirs: ["../public"], 22 | }; 23 | export default config; 24 | -------------------------------------------------------------------------------- /demo/website/.storybook/preview.ts: -------------------------------------------------------------------------------- 1 | import type { Preview } from "@storybook/react"; 2 | 3 | const preview: Preview = { 4 | parameters: { 5 | actions: { argTypesRegex: "^on[A-Z].*" }, 6 | controls: { 7 | matchers: { 8 | color: /(background|color)$/i, 9 | date: /Date$/, 10 | }, 11 | }, 12 | }, 13 | }; 14 | 15 | export default preview; 16 | -------------------------------------------------------------------------------- /demo/website/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-genai-conversational-rag-reference/12610eabf8662d1890ca58cbd48a62cb40aad4dc/demo/website/public/favicon.ico -------------------------------------------------------------------------------- /demo/website/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-genai-conversational-rag-reference/12610eabf8662d1890ca58cbd48a62cb40aad4dc/demo/website/public/logo192.png -------------------------------------------------------------------------------- /demo/website/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-genai-conversational-rag-reference/12610eabf8662d1890ca58cbd48a62cb40aad4dc/demo/website/public/logo512.png -------------------------------------------------------------------------------- /demo/website/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /demo/website/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /demo/website/public/runtime-config.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiUrl": "https://.execute-api..amazonaws.com/prod/", 3 | "region": "", 4 | "identityPoolId": "", 5 | "userPoolId": "", 6 | "userPoolWebClientId": "", 7 | "dataSovereigntyRisk": "false", 8 | "inferenceBufferedFunctionUrl": "https://.lambda-url..on.aws/" 9 | } 10 | -------------------------------------------------------------------------------- /demo/website/src/components/Empty.tsx: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import Box from '@cloudscape-design/components/box'; 4 | 5 | export default function EmptyState({ 6 | title, 7 | subtitle, 8 | action, 9 | }: { 10 | title: string; 11 | subtitle: string; 12 | action?: React.ReactNode; 13 | }) { 14 | return ( 15 | 16 | 17 | {title} 18 | 19 | 20 | {subtitle} 21 | 22 | {action} 23 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /demo/website/src/components/buttons/ModalButton.tsx: -------------------------------------------------------------------------------- 1 | /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. 2 | PDX-License-Identifier: Apache-2.0 */ 3 | import { Button, ButtonProps, Modal, ModalProps } from '@cloudscape-design/components'; 4 | import { FC, PropsWithChildren, useState } from 'react'; 5 | 6 | export interface ModalButtonProps { 7 | readonly modal: Omit; 8 | readonly button: Omit; 9 | } 10 | 11 | export const ModalButton: FC> = ({ children, modal, button }) => { 12 | const [visisble, setVisible] = useState(false); 13 | 14 | return ( 15 | <> 16 |