From 03370bc85bb529e8e35320c98ee14912b05246ab Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Fri, 1 Dec 2023 19:28:27 -0800 Subject: [PATCH] links struggle --- docs/docs/expression_language/why.ipynb | 5 +- .../integrations/callbacks/confident.ipynb | 2 +- docs/docs/integrations/chat/baichuan.ipynb | 50 ++++++++++--------- docs/docs/modules/agents/how_to/mrkl.mdx | 24 ++++----- .../connecting_to_a_feature_store.ipynb | 2 +- docs/docusaurus.config.js | 5 +- docs/package.json | 3 ++ docs/yarn.lock | 45 +++++++++++++++++ 8 files changed, 96 insertions(+), 40 deletions(-) diff --git a/docs/docs/expression_language/why.ipynb b/docs/docs/expression_language/why.ipynb index a1e17a1cbdd..510f57a6cd5 100644 --- a/docs/docs/expression_language/why.ipynb +++ b/docs/docs/expression_language/why.ipynb @@ -9,8 +9,9 @@ "sidebar_position: 0.5\n", "title: Why use LCEL\n", "---\n", - "\n", - "{ import { ColumnContainer, Column } from \"@theme/Columns\"; }" + "```{=mdx}\n", + "import {ColumnContainer, Column} from '@theme/Columns';\n", + "```" ] }, { diff --git a/docs/docs/integrations/callbacks/confident.ipynb b/docs/docs/integrations/callbacks/confident.ipynb index b0d56763391..7ca36af6b4e 100644 --- a/docs/docs/integrations/callbacks/confident.ipynb +++ b/docs/docs/integrations/callbacks/confident.ipynb @@ -277,7 +277,7 @@ "\n", "DeepEval also offers other features such as being able to [automatically create unit tests](https://docs.confident-ai.com/docs/quickstart/synthetic-data-creation), [tests for hallucination](https://docs.confident-ai.com/docs/measuring_llm_performance/factual_consistency).\n", "\n", - "If you are interested, check out our Github repository here [https://github.com/confident-ai/deepeval](https://github.com/confident-ai/deepeval). We welcome any PRs and discussions on how to improve LLM performance." + "If you are interested, check out our Github repository [here](https://github.com/confident-ai/deepeval). We welcome any PRs and discussions on how to improve LLM performance." ] } ], diff --git a/docs/docs/integrations/chat/baichuan.ipynb b/docs/docs/integrations/chat/baichuan.ipynb index 9f9376beeea..0ef5f862cfd 100644 --- a/docs/docs/integrations/chat/baichuan.ipynb +++ b/docs/docs/integrations/chat/baichuan.ipynb @@ -6,7 +6,7 @@ "source": [ "# Baichuan Chat\n", "\n", - "Baichuan chat models API by Baichuan Intelligent Technology. For more information, see [https://platform.baichuan-ai.com/docs/api](https://platform.baichuan-ai.com/docs/api)" + "Baichuan chat models API by Baichuan Intelligent Technology. For more information, see [https://platform.baichuan-ai.com/docs/api](https://platform.baichuan-ai.com/docs/api/)" ] }, { @@ -63,7 +63,9 @@ "outputs": [ { "data": { - "text/plain": "AIMessage(content='首先,我们需要确定闰年的二月有多少天。闰年的二月有29天。\\n\\n然后,我们可以计算你的月薪:\\n\\n日薪 = 月薪 / (当月天数)\\n\\n所以,你的月薪 = 日薪 * 当月天数\\n\\n将数值代入公式:\\n\\n月薪 = 8元/天 * 29天 = 232元\\n\\n因此,你在闰年的二月的月薪是232元。')" + "text/plain": [ + "AIMessage(content='首先,我们需要确定闰年的二月有多少天。闰年的二月有29天。\\n\\n然后,我们可以计算你的月薪:\\n\\n日薪 = 月薪 / (当月天数)\\n\\n所以,你的月薪 = 日薪 * 当月天数\\n\\n将数值代入公式:\\n\\n月薪 = 8元/天 * 29天 = 232元\\n\\n因此,你在闰年的二月的月薪是232元。')" + ] }, "execution_count": 3, "metadata": {}, @@ -76,16 +78,23 @@ }, { "cell_type": "markdown", - "source": [ - "## For ChatBaichuan with Streaming" - ], "metadata": { "collapsed": false - } + }, + "source": [ + "## For ChatBaichuan with Streaming" + ] }, { "cell_type": "code", "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2023-10-17T15:14:25.870044Z", + "start_time": "2023-10-17T15:14:25.863381Z" + }, + "collapsed": false + }, "outputs": [], "source": [ "chat = ChatBaichuan(\n", @@ -93,22 +102,24 @@ " baichuan_secret_key=\"YOUR_SECRET_KEY\",\n", " streaming=True,\n", ")" - ], - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2023-10-17T15:14:25.870044Z", - "start_time": "2023-10-17T15:14:25.863381Z" - } - } + ] }, { "cell_type": "code", "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2023-10-17T15:14:27.153546Z", + "start_time": "2023-10-17T15:14:25.868470Z" + }, + "collapsed": false + }, "outputs": [ { "data": { - "text/plain": "AIMessageChunk(content='首先,我们需要确定闰年的二月有多少天。闰年的二月有29天。\\n\\n然后,我们可以计算你的月薪:\\n\\n日薪 = 月薪 / (当月天数)\\n\\n所以,你的月薪 = 日薪 * 当月天数\\n\\n将数值代入公式:\\n\\n月薪 = 8元/天 * 29天 = 232元\\n\\n因此,你在闰年的二月的月薪是232元。')" + "text/plain": [ + "AIMessageChunk(content='首先,我们需要确定闰年的二月有多少天。闰年的二月有29天。\\n\\n然后,我们可以计算你的月薪:\\n\\n日薪 = 月薪 / (当月天数)\\n\\n所以,你的月薪 = 日薪 * 当月天数\\n\\n将数值代入公式:\\n\\n月薪 = 8元/天 * 29天 = 232元\\n\\n因此,你在闰年的二月的月薪是232元。')" + ] }, "execution_count": 6, "metadata": {}, @@ -117,14 +128,7 @@ ], "source": [ "chat([HumanMessage(content=\"我日薪8块钱,请问在闰年的二月,我月薪多少\")])" - ], - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2023-10-17T15:14:27.153546Z", - "start_time": "2023-10-17T15:14:25.868470Z" - } - } + ] } ], "metadata": { diff --git a/docs/docs/modules/agents/how_to/mrkl.mdx b/docs/docs/modules/agents/how_to/mrkl.mdx index 2269766ee42..d666438d838 100644 --- a/docs/docs/modules/agents/how_to/mrkl.mdx +++ b/docs/docs/modules/agents/how_to/mrkl.mdx @@ -65,9 +65,9 @@ mrkl.run("Who is Leo DiCaprio's girlfriend? What is her current age raised to th > Entering new LLMMathChain chain... 21^0.43 - ```text + \`\`\`text 21**0.43 - ``` + \`\`\` ...numexpr.evaluate("21**0.43")... Answer: 3.7030049853137306 @@ -173,29 +173,29 @@ mrkl.run("Who is Leo DiCaprio's girlfriend? What is her current age raised to th > Entering new AgentExecutor chain... Thought: The first question requires a search, while the second question requires a calculator. Action: - ``` + \`\`\` { "action": "Search", "action_input": "Leo DiCaprio girlfriend" } - ``` + \`\`\` Observation: Gigi Hadid: 2022 Leo and Gigi were first linked back in September 2022, when a source told Us Weekly that Leo had his “sights set" on her (alarming way to put it, but okay). Thought:For the second question, I need to calculate the age raised to the 0.43 power. I will use the calculator tool. Action: - ``` + \`\`\` { "action": "Calculator", "action_input": "((2022-1995)^0.43)" } - ``` + \`\`\` > Entering new LLMMathChain chain... ((2022-1995)^0.43) - ```text + \`\`\`text (2022-1995)**0.43 - ``` + \`\`\` ...numexpr.evaluate("(2022-1995)**0.43")... Answer: 4.125593352125936 @@ -225,22 +225,22 @@ mrkl.run("What is the full name of the artist who recently released an album cal Question: What is the full name of the artist who recently released an album called 'The Storm Before the Calm' and are they in the FooBar database? If so, what albums of theirs are in the FooBar database? Thought: I should use the Search tool to find the answer to the first part of the question and then use the FooBar DB tool to find the answer to the second part. Action: - ``` + \`\`\` { "action": "Search", "action_input": "Who recently released an album called 'The Storm Before the Calm'" } - ``` + \`\`\` Observation: Alanis Morissette Thought:Now that I know the artist's name, I can use the FooBar DB tool to find out if they are in the database and what albums of theirs are in it. Action: - ``` + \`\`\` { "action": "FooBar DB", "action_input": "What albums does Alanis Morissette have in the database?" } - ``` + \`\`\` > Entering new SQLDatabaseChain chain... diff --git a/docs/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store.ipynb b/docs/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store.ipynb index cc6e432df47..fa65bd6df31 100644 --- a/docs/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store.ipynb +++ b/docs/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store.ipynb @@ -232,7 +232,7 @@ "source": [ "### Prerequisites\n", "\n", - "* Tecton Deployment (sign up at [https://tecton.ai](https://tecton.ai))\n", + "* Tecton Deployment (sign up at [https://tecton.ai](https://tecton.ai/))\n", "* `TECTON_API_KEY` environment variable set to a valid Service Account key" ] }, diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index cd02a0e528b..579d6d33647 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -29,6 +29,9 @@ const config = { themes: ["@docusaurus/theme-mermaid"], markdown: { mermaid: true, + preprocessor: ({filePath, fileContent}) => { + return fileContent.replaceAll(/<([^>@]*@[^@])>/g, '$1').replaceAll(/<([^:>]:\/\/[^>]*)>/g, '$1') + } }, plugins: [ @@ -105,7 +108,7 @@ const config = { }, }, pages: { - remarkPlugins: [require("@docusaurus/remark-plugin-npm2yarn")], + remarkPlugins: [require("@docusaurus/remark-plugin-npm2yarn"), require('remark-heading-id'), require('remark-inline-links')], }, theme: { customCss: require.resolve("./src/css/custom.css"), diff --git a/docs/package.json b/docs/package.json index 0630e567840..2de836d0141 100644 --- a/docs/package.json +++ b/docs/package.json @@ -31,6 +31,9 @@ "process": "^0.11.10", "react": "^18", "react-dom": "^18", + "remark-gfm": "^4.0.0", + "remark-heading-id": "^1.0.1", + "remark-inline-links": "^7.0.0", "typescript": "^5.1.3", "webpack": "^5.75.0" }, diff --git a/docs/yarn.lock b/docs/yarn.lock index 0580dd7e159..1f9f26c85ab 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -6555,6 +6555,15 @@ marked@^4.3.0: resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== +mdast-util-definitions@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz#c1bb706e5e76bb93f9a09dd7af174002ae69ac24" + integrity sha512-scTllyX6pnYNZH/AIp/0ePz6s4cZtARxImwoPJ7kS42n+MnVsI4XbnG6d4ibehRIldYMWM2LD7ImQblVhUejVQ== + dependencies: + "@types/mdast" "^4.0.0" + "@types/unist" "^3.0.0" + unist-util-visit "^5.0.0" + mdast-util-directive@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mdast-util-directive/-/mdast-util-directive-3.0.0.tgz#3fb1764e705bbdf0afb0d3f889e4404c3e82561f" @@ -8793,6 +8802,23 @@ remark-gfm@^4.0.0: remark-stringify "^11.0.0" unified "^11.0.0" +remark-heading-id@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/remark-heading-id/-/remark-heading-id-1.0.1.tgz#5500b8cbc12ba6cc36fc5ccc2a3ff3d6e5cf981e" + integrity sha512-GmJjuCeEkYvwFlvn/Skjc/1Qafj71412gbQnrwUmP/tKskmAf1cMRlZRNoovV+aIvsSRkTb2rCmGv2b9RdoJbQ== + dependencies: + lodash "^4.17.21" + unist-util-visit "^1.4.0" + +remark-inline-links@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/remark-inline-links/-/remark-inline-links-7.0.0.tgz#77fbff8061abc3d0ec34187ab71678a710df05e1" + integrity sha512-4uj1pPM+F495ySZhTIB6ay2oSkTsKgmYaKk/q5HIdhX2fuyLEegpjWa0VdJRJ01sgOqAFo7MBKdDUejIYBMVMQ== + dependencies: + "@types/mdast" "^4.0.0" + mdast-util-definitions "^6.0.0" + unist-util-visit "^5.0.0" + remark-mdx@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-3.0.0.tgz#146905a3925b078970e05fc89b0e16b9cc3bfddd" @@ -9834,6 +9860,11 @@ unique-string@^3.0.0: dependencies: crypto-random-string "^4.0.0" +unist-util-is@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" + integrity sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A== + unist-util-is@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-6.0.0.tgz#b775956486aff107a9ded971d996c173374be424" @@ -9877,6 +9908,13 @@ unist-util-stringify-position@^4.0.0: dependencies: "@types/unist" "^3.0.0" +unist-util-visit-parents@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz#25e43e55312166f3348cae6743588781d112c1e9" + integrity sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g== + dependencies: + unist-util-is "^3.0.0" + unist-util-visit-parents@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz#4d5f85755c3b8f0dc69e21eca5d6d82d22162815" @@ -9885,6 +9923,13 @@ unist-util-visit-parents@^6.0.0: "@types/unist" "^3.0.0" unist-util-is "^6.0.0" +unist-util-visit@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" + integrity sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw== + dependencies: + unist-util-visit-parents "^2.0.0" + unist-util-visit@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-5.0.0.tgz#a7de1f31f72ffd3519ea71814cccf5fd6a9217d6"