docs[patch]: search experiment (#14254)

- npm
- search config
- custom
This commit is contained in:
Erick Friis 2023-12-04 16:58:26 -08:00 committed by GitHub
parent 4fb72ff76f
commit 4351b99d2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 343 additions and 922 deletions

View File

@ -9,7 +9,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd)"
cd "${SCRIPT_DIR}"
mkdir -p ../_dist
rsync -ruv . ../_dist
rsync -ruv --exclude node_modules . ../_dist
cd ../_dist
poetry run python scripts/model_feat_table.py
cp ../cookbook/README.md src/pages/cookbook.mdx

View File

@ -14,9 +14,6 @@ const config = {
title: "🦜️🔗 Langchain",
tagline: "LangChain Python Docs",
favicon: "img/favicon.ico",
customFields: {
mendableAnonKey: process.env.MENDABLE_ANON_KEY,
},
// Set the production url of your site here
url: "https://python.langchain.com",
// Set the /<baseUrl>/ pathname under which your site is served
@ -310,6 +307,18 @@ const config = {
],
copyright: `Copyright © ${new Date().getFullYear()} LangChain, Inc.`,
},
algolia: {
// The application ID provided by Algolia
appId: "VAU016LAWS",
// Public API key: it is safe to commit it
// this is linked to erick@langchain.dev currently
apiKey: "6c01842d6a88772ed2236b9c85806441",
indexName: "python-langchain",
contextualSearch: true,
},
}),
scripts: [
@ -319,6 +328,7 @@ const config = {
async: true,
},
],
};
module.exports = config;

1186
docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,12 +19,11 @@
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,md,mdx}\""
},
"dependencies": {
"@docusaurus/core": "2.4.0",
"@docusaurus/preset-classic": "2.4.0",
"@docusaurus/remark-plugin-npm2yarn": "^2.4.0",
"@docusaurus/theme-mermaid": "2.4.0",
"@docusaurus/core": "2.4.3",
"@docusaurus/preset-classic": "2.4.3",
"@docusaurus/remark-plugin-npm2yarn": "^2.4.3",
"@docusaurus/theme-mermaid": "2.4.3",
"@mdx-js/react": "^1.6.22",
"@mendable/search": "^0.0.160",
"clsx": "^1.2.1",
"json-loader": "^0.5.7",
"process": "^0.11.10",

View File

@ -36,23 +36,6 @@
--ifm-color-primary-lightest: #4fddbf;
}
.mendable-search {
width: 175px;
}
/* Reduce width on mobile for Mendable Search */
@media (max-width: 500px) {
.mendable-search {
width: 150px;
}
}
@media (max-width: 380px) {
.mendable-search {
width: 140px;
}
}
.footer__links {
margin-top: 1rem;
margin-bottom: 3rem;

View File

@ -1,35 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import React from "react";
import { MendableSearchBar } from "@mendable/search";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
export default function SearchBarWrapper() {
const {
siteConfig: { customFields },
} = useDocusaurusContext();
return (
<div className="mendable-search">
<MendableSearchBar
anon_key={customFields.mendableAnonKey}
style={{ accentColor: "#4F956C", darkMode: false }}
placeholder="Search"
dialogPlaceholder="How do I use a LLM Chain?"
messageSettings={{ openSourcesInNewTab: false, prettySources: true }}
searchBarStyle={{
borderColor: "#9d9ea1",
color:"#9d9ea1"
}}
askAIText="Ask Mendable AI"
isPinnable
showSimpleSearch
/>
</div>
);
}