Skip to content

Commit

Permalink
Add chat function to data extract (#88)
Browse files Browse the repository at this point in the history
fixes #51

Signed-off-by: Sean Sundberg <[email protected]>
  • Loading branch information
seansund authored Sep 24, 2023
1 parent 7d54e69 commit 874057b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@carbon/grid": "^11.20.0",
"@carbon/icons-react": "^11.27.0",
"@carbon/react": "^1.38.0",
"@ibm-watson/assistant-web-chat-react": "^1.0.4",
"dayjs": "^1.11.10",
"graphql-ws": "^5.14.0",
"jotai": "^2.4.2",
Expand Down
8 changes: 8 additions & 0 deletions src/views/DataExtraction/DataExtraction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {DataTable, Stack} from "../../components";
import {DataExtractionQuestionModel} from "../../models";
import {Loadable} from "jotai/vanilla/utils/loadable";
import {handleFileUploaderChange} from "../KYC/KYCCaseDetail/util";
import {WebChatConfig, WebChatContainer} from "@ibm-watson/assistant-web-chat-react";

export interface DataExtractionProps {
}
Expand Down Expand Up @@ -113,6 +114,12 @@ export const DataExtraction: React.FunctionComponent<DataExtractionProps> = () =
setResults(Promise.resolve([]))
}

const webChatConfig: WebChatConfig = {
integrationID: '76f5a344-3d6e-4e87-89d4-ec4fb39ee08a', // The ID of this integration.
region: 'us-south', // The region your integration is hosted in.
serviceInstanceID: '683c39a0-98db-4651-b97d-49f770fb058c', // The ID of your service instance.
}

return (
<div>
<Form onSubmit={handleSubmit}>
Expand Down Expand Up @@ -163,6 +170,7 @@ export const DataExtraction: React.FunctionComponent<DataExtractionProps> = () =
<div><Button kind="tertiary" onClick={handleReset}>Reset</Button> <Button type="submit">Submit</Button></div>
</Stack>
</Form>
<WebChatContainer config={webChatConfig} />
<DataExtractionResults />
</div>
)
Expand Down

0 comments on commit 874057b

Please sign in to comment.