Skip to content

Commit e40d206

Browse files
committed
Add an AI search component
1 parent 8594184 commit e40d206

7 files changed

Lines changed: 1172 additions & 35 deletions

File tree

docusaurus.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ const config: Config = {
246246
{ rootDir: ".integrationBuilderCache" },
247247
],
248248
path.resolve(__dirname, "plugins", "node-polyfills"),
249+
path.resolve(__dirname, "plugins", "env-variables-plugin"),
249250
[
250251
"@docusaurus/plugin-client-redirects",
251252
{

package-lock.json

Lines changed: 163 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
"hast-util-is-element": "^1.1.0",
3838
"joi": "^17.13.3",
3939
"lodash": "^4.17.21",
40+
"marked": "^15.0.11",
41+
"openai": "^4.96.0",
4042
"parse-numeric-range": "^1.3.0",
4143
"prism-react-renderer": "^2.3.1",
4244
"prismjs": "^1.30.0",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// A Docusaurus plugin to provide environment variables to the client
2+
3+
module.exports = function (context, options) {
4+
return {
5+
name: "docusaurus-env-variables-plugin",
6+
injectHtmlTags() {
7+
return {
8+
headTags: [
9+
{
10+
tagName: "script",
11+
innerHTML: `window.OPENAI_API_KEY = "${process.env.OPENAI_API_KEY || ""}"`,
12+
},
13+
],
14+
};
15+
},
16+
};
17+
};

0 commit comments

Comments
 (0)