Skip to content

Commit

Permalink
feat: add LuzmoAIChatComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulieScanlon committed Nov 3, 2024
1 parent 2476ac0 commit 45a898b
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 10 deletions.
180 changes: 175 additions & 5 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 @@
"@astrojs/netlify": "^5.5.0",
"@astrojs/react": "^3.6.1",
"@luzmo/nodejs-sdk": "^1.3.0",
"@luzmo/react-embed": "^5.1.2-beta.4",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.0.6",
Expand Down
19 changes: 16 additions & 3 deletions src/components/luzmo-client-component.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import { LuzmoAIChatComponent } from '@luzmo/react-embed';

interface Props {
authKey: string;
authToken: string;
}

export default function LuzmoClientComponent({ authKey, authToken }: Props) {
console.log({ authKey, authToken });

return <section>Luzmo client component</section>;
return (
<section>
<LuzmoAIChatComponent
appServer={import.meta.env.PUBLIC_LUZMO_APP_SERVER}
apiHost={import.meta.env.PUBLIC_LUZMO_API_HOST}
authKey={authKey}
authToken={authToken}
options={{
showChart: true,
showConfiguration: true,
}}
/>
</section>
);
}
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const response = await client.create('authorization', {
access: {
datasets: [
{
id: '<dataset_id>',
id: '6f18525f-7b4f-4726-bc20-ccc4665d3091',
rights: 'use',
},
],
Expand All @@ -35,6 +35,6 @@ const { id, token } = response;
<title>Astro</title>
</head>
<body>
<LuzmoClientComponent authKey={id} authToken={token} client:load />
<LuzmoClientComponent authKey={id} authToken={token} client:only='react' />
</body>
</html>

0 comments on commit 45a898b

Please sign in to comment.