Skip to content

Commit

Permalink
docs: add generating llm providers page
Browse files Browse the repository at this point in the history
  • Loading branch information
priyashpatil committed Aug 18, 2024
1 parent 18ae4d6 commit 9d63609
Show file tree
Hide file tree
Showing 33 changed files with 894 additions and 18 deletions.
Binary file not shown.
830 changes: 830 additions & 0 deletions docs/docs/reference/llm-providers.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ const config = {
from: "/quickstart",
to: "/install/vscode",
},
{
from: ['/reference/Model%20Providers/:splat*', '/reference/Model Providers/:splat*'],
to: '/reference/llm-providers',
}
],
},
],
Expand Down
55 changes: 55 additions & 0 deletions docs/generate-references.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const fs = require('fs').promises;
const path = require('path');

async function combineMarkdownFiles(sourceDir, outputFile) {
try {
console.log(`Reading directory: ${sourceDir}`);
const files = await fs.readdir(sourceDir);
console.log(`Found ${files.length} files`);

const markdownFiles = files
.filter(file => file.endsWith('.md'))
.sort();
console.log(`Found ${markdownFiles.length} Markdown files`);

const pageMeta = `---
id: llm-providers
title: LLM Providers
sidebar_label: 🤖 LLM Providers
toc_max_heading_level: 2
description: Overview of the various LLM providers supported by Continue
keywords: [LLM, language models, AI, machine learning, natural language processing]
---
`;

const autoGeneratedWarning = `
<!--
WARNING: This file is auto-generated. Any manual changes to this file will be overwritten.
-->
`;

let combinedContent = pageMeta + autoGeneratedWarning;

for (const file of markdownFiles) {
console.log(`Processing file: ${file}`);
const filePath = path.join(sourceDir, file);
let content = await fs.readFile(filePath, 'utf8');

// Add one '#' to each heading
content = content.replace(/^(#+)\s/gm, '#$1 ');

combinedContent += `\n\n${content}`;
}

console.log(`Writing combined content to: ${outputFile}`);
await fs.writeFile(outputFile, combinedContent.trim());
console.log(`Combined Markdown file generated: ${outputFile}`);
} catch (error) {
console.error('Error combining Markdown files:', error);
}
}

const sourceDirectory = './llm-providers';
const outputFile = './docs/reference/llm-providers.md';

combineMarkdownFiles(sourceDirectory, outputFile);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ Watsonx, developed by IBM, offers a variety of pre-trained AI foundation models
To access the Watsonx models, create an instance in the [IBM cloud](https://cloud.ibm.com) which supports watsonx studio. Then to create a project refer [this](https://www.ibm.com/docs/en/watsonx/saas?topic=projects-creating-project).

You can set it up in two different ways :

1. **Using API** : Create Your IBM cloud API key by referring [this](https://www.ibm.com/docs/en/mas-cd/continuous-delivery?topic=cli-creating-your-cloud-api-key).
2. **Using Credentials** : Use your Username and Password to authenticate


## Usage
![usage-gif](../Model%20Providers/assets/Watsonx1.gif)
5 changes: 3 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "nodemon --watch sidebars.js --watch docusaurus.config.js --exec 'docusaurus start'",
"start": "npm run genereate-references && nodemon --watch sidebars.js --watch docusaurus.config.js --exec 'docusaurus start'",
"build": "docusaurus build",
"build:netlify": "docusaurus build --out-dir build/docs",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
"write-heading-ids": "docusaurus write-heading-ids",
"genereate-references": "node generate-references.js"
},
"dependencies": {
"@docusaurus/core": "^3.4.0",
Expand Down
13 changes: 1 addition & 12 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,7 @@ const sidebars = {
],
referenceSidebar: [
"reference/config",
{
type: "category",
label: "🤖 LLM Providers",
collapsible: true,
collapsed: true,
items: [
{
type: "autogenerated",
dirName: "reference/Model Providers",
},
],
},
"reference/llm-providers",
"reference/embedding-providers",
"reference/reranking-providers",
],
Expand Down

0 comments on commit 9d63609

Please sign in to comment.