Skip to content

Commit ee44f0f

Browse files
committed
Update to v4
1 parent 85bf45a commit ee44f0f

File tree

3 files changed

+28
-217
lines changed

3 files changed

+28
-217
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@sentry/browser": "^8.51.0",
4848
"@types/react": "^18.3.3",
4949
"clsx": "^2.1.1",
50-
"docusaurus-openai-search": "^3.1.0",
50+
"docusaurus-openai-search": "^4.0.0",
5151
"docusaurus-plugin-sass": "^0.2.5",
5252
"docusaurus-plugin-segment": "^1.0.4",
5353
"dotenv": "^16.4.7",

src/theme/SearchBar.tsx

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,36 @@ export default function SearchBar() {
99
},
1010
} = useDocusaurusContext();
1111

12-
const systemPrompt =
13-
"You are a helpful Metamask expert assistant. Your goal is to provide detailed, accurate information about Metamask's integrations to developers.\n\n" +
14-
"RESPONSE GUIDELINES:\n" +
15-
"1. BE HELPFUL: Always try to provide SOME guidance, even when the documentation doesn't contain a perfect answer.\n" +
16-
"2. PRIORITIZE USER SUCCESS: Focus on helping the user accomplish their task with Metamask.\n" +
17-
"3. USE DOCUMENTATION FIRST: Base your answers primarily on the provided documentation snippets.\n" +
18-
"4. CODE EXAMPLES ARE CRUCIAL: Always include code snippets from the documentation when available, as they're extremely valuable to developers.\n" +
19-
"5. INFERENCE IS ALLOWED: When documentation contains related but not exact information, use reasonable inference to bridge gaps based on standard Metamask patterns.\n" +
20-
"6. BE HONEST: If you truly can't provide an answer, suggest relevant Metamask concepts or documentation sections that might help instead.\n" +
21-
"7. NEVER SAY JUST 'NO SPECIFIC INSTRUCTIONS': Always provide related information or suggest alternative approaches.\n\n" +
22-
"ABOUT METAMASK:\n" +
23-
"- MetaMask is a leading self-custodial wallet for Web3 that enables users to manage their digital assets and interact with decentralized applications\n" +
24-
"- The MetaMask SDK allows developers to easily integrate MetaMask functionality into their applications across multiple platforms\n" +
25-
"- MetaMask Snaps is an extension system that allows developers to add new features and capabilities to the MetaMask wallet\n" +
26-
"- The MetaMask CLI provides developer tools for building, testing, and deploying Snaps and other MetaMask integrations\n" +
27-
"- The MetaMask Dashboard offers developers analytics and management tools for their dApps and integrations\n" +
28-
"- MetaMask supports multiple networks including Ethereum, Layer 2 solutions, and various EVM-compatible chains\n" +
29-
"- Developers can use MetaMask's comprehensive API to enable wallet connections, transaction signing, and other Web3 functionality";
30-
3112
// AI search configuration
3213
const aiConfig = {
33-
// OpenAI API settings
34-
openAI: {
35-
proxyUrl: "https://docusaurus-openai-search-backend.vercel.app",
36-
model: "gpt-4.1",
37-
maxTokens: 32768,
38-
temperature: 0.45,
14+
backend: {
15+
url: "https://docusaurus-openai-search-backend.vercel.app",
16+
},
17+
context: {
18+
siteName: "Metamask Documentation",
19+
systemContext:
20+
"ABOUT METAMASK:\n" +
21+
"- MetaMask is a leading self-custodial wallet for Web3 that enables users to manage their digital assets and interact with decentralized applications\n" +
22+
"- The MetaMask SDK allows developers to easily integrate MetaMask functionality into their applications across multiple platforms\n" +
23+
"- MetaMask Snaps is an extension system that allows developers to add new features and capabilities to the MetaMask wallet\n" +
24+
"- The MetaMask CLI provides developer tools for building, testing, and deploying Snaps and other MetaMask integrations\n" +
25+
"- The MetaMask Dashboard offers developers analytics and management tools for their dApps and integrations\n" +
26+
"- MetaMask supports multiple networks including Ethereum, Layer 2 solutions, and various EVM-compatible chains\n" +
27+
"- Developers can use MetaMask's comprehensive API to enable wallet connections, transaction signing, and other Web3 functionality",
3928
},
40-
// UI customization
4129
ui: {
4230
aiButtonText: "Ask Metamask AI",
4331
modalTitle: "Metamask AI Assistant",
4432
footerText: "Powered by Metamask AI",
33+
searchButtonText: "Search with AI",
34+
searchButtonAriaLabel: "Search with Metamask AI",
35+
showSearchButtonShortcut: false,
36+
useCustomSearchButton: true,
4537
},
46-
// Prompt customization
47-
prompts: {
48-
siteName: "Metamask",
49-
systemPrompt,
50-
includeLlmsFile: true,
38+
enableLogging: true,
39+
enableCaching: true,
40+
recaptcha: {
41+
siteKey: "6LeotlkrAAAAAEREf2umQgDoO2l3zfqUdJR599LV",
5142
},
5243
};
5344
// @ts-ignore

0 commit comments

Comments
 (0)