Skip to content
Merged

Ai #186

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ const config = {
// Public API key: it is safe to commit it
apiKey: "e988677555350573b539eb974e2b7891",
indexName: "phcode",
contextualSearch: false
contextualSearch: false,
askAi: {
assistantId: "d43f2205-8075-439d-822b-b3825b74cb49",
apiKey: "0c73a640624ba54f777a5491ee884aa3",
indexName: "markdown-index",
}
},
// Replace with your project's social card
image: "img/socialcard.png",
Expand Down
213 changes: 22 additions & 191 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"serveStatic": "http-server build -p 8001 -c-1"
},
"dependencies": {
"@docsearch/css": "^4.6.0",
"@docsearch/react": "^4.6.0",
"@docusaurus/core": "^3.7.0",
"@docusaurus/plugin-client-redirects": "^3.7.0",
"@docusaurus/plugin-google-gtag": "^3.7.0",
Expand All @@ -38,6 +40,7 @@
"devDependencies": {
"@docusaurus/module-type-aliases": "3.9.2",
"@docusaurus/types": "3.9.2",
"baseline-browser-mapping": "^2.10.10",
"http-server": "14.1.1",
"shx": "0.4.0"
},
Expand Down
14 changes: 14 additions & 0 deletions src/theme/SearchBar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import SearchBar from '@theme-original/SearchBar';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';

// Wrap SearchBar to inject agentStudio: true into askAi config.
// Docusaurus 3.9.2's Joi validation doesn't recognize agentStudio yet,
// but @docsearch/react 4.6+ requires it for Agent Studio assistants.
export default function SearchBarWrapper(props) {
const {siteConfig} = useDocusaurusContext();
const askAi = siteConfig.themeConfig.algolia?.askAi;
if (askAi && !askAi.agentStudio) {
askAi.agentStudio = true;
}
return <SearchBar {...props} />;
}
Loading