Skip to content

Commit ce974f8

Browse files
committed
Update to v4
1 parent 33d06a3 commit ce974f8

File tree

2 files changed

+21
-31
lines changed

2 files changed

+21
-31
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"classnames": "^2.5.1",
4141
"clsx": "^1.2.1",
4242
"copy-to-clipboard": "^3.3.3",
43-
"docusaurus-openai-search": "^3.3.0",
43+
"docusaurus-openai-search": "file:../docusaurus-openai-search/docusaurus-openai-search-4.0.0.tgz",
4444
"gray-matter": "^4.0.3",
4545
"hast-util-is-element": "^1.1.0",
4646
"joi": "^17.13.3",

src/theme/SearchBar/index.tsx

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,35 @@ export default function SearchBar() {
77
siteConfig: { themeConfig },
88
} = useDocusaurusContext();
99

10-
const systemPrompt =
11-
"You are a helpful Web3Auth expert assistant. Your goal is to provide detailed, accurate information about Web3Auth's authentication solutions, SDKs, and integrations to developers.\n\n" +
12-
"RESPONSE GUIDELINES:\n" +
13-
"1. BE HELPFUL: Always try to provide SOME guidance, even when the documentation doesn't contain a perfect answer.\n" +
14-
"2. PRIORITIZE USER SUCCESS: Focus on helping the user accomplish their task with Web3Auth.\n" +
15-
"3. USE DOCUMENTATION FIRST: Base your answers primarily on the provided documentation snippets.\n" +
16-
"4. CODE EXAMPLES ARE CRUCIAL: Always include code snippets from the documentation when available, as they're extremely valuable to developers.\n" +
17-
"5. INFERENCE IS ALLOWED: When documentation contains related but not exact information, use reasonable inference to bridge gaps based on standard Web3Auth patterns.\n" +
18-
"6. BE HONEST: If you truly can't provide an answer, suggest relevant Web3Auth concepts or documentation sections that might help instead.\n" +
19-
"7. NEVER SAY JUST 'NO SPECIFIC INSTRUCTIONS': Always provide related information or suggest alternative approaches.\n\n" +
20-
"ABOUT WEB3AUTH:\n" +
21-
"- Web3Auth provides authentication infrastructure for Web3 applications\n" +
22-
"- Core products include Plug and Play (PnP) SDKs for Web, Mobile (Android, iOS, React Native, Flutter) and Gaming (Unity & Unreal Engine). Single Factor Auth (SFA) for Mobile & Backend, MPC Core Kit SDK (enterprise only sdk) for Web and React Native.\n" +
23-
"- Try to recommend solutions with Plug and Play Web Modal and No Modal SDKs as much as possible, which have React Hooks and Vue Composables as well." +
24-
"- Uses Shamir Secret Sharing (SSS) for PnP & SFA and Threshold Signature Scheme (TSS) - MPC for MPC Core Kit for enabling secure key management\n" +
25-
"- Compatible with all OAuth2 providers like Google, Facebook, Discord, Auth0, Firebase, etc., while having the ability to connect to any custom OAuth provider.";
26-
2710
// AI search configuration
2811
const aiConfig = {
29-
// OpenAI API settings
30-
openAI: {
31-
proxyUrl: "https://docusaurus-openai-search-backend.vercel.app",
32-
model: "gpt-4.1-nano",
33-
maxTokens: 32768,
34-
temperature: 0.3,
12+
backend: {
13+
url: "https://docusaurus-openai-search-backend.vercel.app",
14+
},
15+
context: {
16+
siteName: "Web3Auth Documentation",
17+
systemContext:
18+
"ABOUT WEB3AUTH:\n" +
19+
"- Web3Auth provides authentication infrastructure for Web3 applications\n" +
20+
"- Core products include Plug and Play (PnP) SDKs for Web, Mobile (Android, iOS, React Native, Flutter) and Gaming (Unity & Unreal Engine). Other SDKs are there, like Single Factor Auth (SFA) for Mobile & Backend, MPC Core Kit SDK (enterprise only sdk) for Web and React Native.\n, However we want to focus on PnP SDKs and their integrations with other services." +
21+
"- Try to recommend solutions with Plug and Play Web Modal and No Modal SDKs as much as possible, which have React Hooks and Vue Composables as well." +
22+
"- Uses Shamir Secret Sharing (SSS) for PnP & SFA and Threshold Signature Scheme (TSS) - MPC for MPC Core Kit for enabling secure key management\n" +
23+
"- Compatible with all OAuth2 providers like Google, Facebook, Discord, Auth0, Firebase, etc., while having the ability to connect to any custom OAuth provider.",
3524
},
36-
// UI customization
3725
ui: {
3826
aiButtonText: "Ask Web3Auth AI",
3927
modalTitle: "Web3Auth AI Assistant",
4028
footerText: "Powered by Web3Auth AI",
41-
},
42-
// Prompt customization
43-
prompts: {
44-
siteName: "Web3Auth",
45-
systemPrompt,
46-
useSummarization: true,
29+
searchButtonText: "Search with AI",
30+
searchButtonAriaLabel: "Search with Web3Auth AI",
31+
showSearchButtonShortcut: false,
32+
useCustomSearchButton: true,
4733
},
4834
enableLogging: true,
35+
enableCaching: true,
36+
recaptcha: {
37+
siteKey: "6LeotlkrAAAAAEREf2umQgDoO2l3zfqUdJR599LV",
38+
},
4939
};
5040
// @ts-ignore
5141
return <DocusaurusAISearch themeConfig={themeConfig} aiConfig={aiConfig} />;

0 commit comments

Comments
 (0)