-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into typo-rerank-2
- Loading branch information
Showing
261 changed files
with
34,036 additions
and
2,431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
const fs = require("fs").promises; | ||
const path = require("path"); | ||
const matter = require("gray-matter"); | ||
|
||
const mdxDir = path.join(__dirname, "../../fern/pages"); | ||
const filePattern = /\.mdx$/; | ||
|
||
// Counters | ||
let totalFilesChecked = 0; | ||
let totalFilesValid = 0; | ||
let totalFilesInvalid = 0; | ||
|
||
// List of folders to exclude (relative to mdxDir) | ||
const excludedFolders = ["-ARCHIVE-", "api-reference", "llm-university"]; | ||
|
||
function shouldExcludeFolder(dirPath) { | ||
return excludedFolders.some((excludedFolder) => { | ||
return path.relative(mdxDir, dirPath).startsWith(excludedFolder); | ||
}); | ||
} | ||
|
||
async function shouldExcludeFile(filePath) { | ||
try { | ||
const fileContent = await fs.readFile(filePath, "utf8"); | ||
const { data } = matter(fileContent); | ||
return data.hidden === true; | ||
} catch (error) { | ||
console.error(`Error reading file "${filePath}":`, error); | ||
return false; // In case of error, don't exclude the file | ||
} | ||
} | ||
|
||
async function checkDescriptionLength(filePath) { | ||
totalFilesChecked++; | ||
const fileContent = await fs.readFile(filePath, "utf8"); | ||
const { data } = matter(fileContent); | ||
|
||
if (!data.description) { | ||
console.log(`File "${filePath}" is missing a description.`); | ||
totalFilesInvalid++; | ||
return false; | ||
} | ||
|
||
const descriptionLength = data.description.length; | ||
|
||
if (descriptionLength < 50 || descriptionLength > 160) { | ||
console.log( | ||
`File "${filePath}" has an invalid description length: ${descriptionLength} characters.` | ||
); | ||
totalFilesInvalid++; | ||
return false; | ||
} | ||
|
||
totalFilesValid++; | ||
return true; | ||
} | ||
|
||
async function checkMDXFiles(dirPath) { | ||
let allFilesValid = true; | ||
const files = await fs.readdir(dirPath); | ||
|
||
for (const file of files) { | ||
const fullPath = path.join(dirPath, file); | ||
const stat = await fs.lstat(fullPath); | ||
|
||
if (stat.isDirectory()) { | ||
if (shouldExcludeFolder(fullPath)) { | ||
console.log(`Skipping excluded directory: ${fullPath}`); | ||
continue; | ||
} | ||
const isValid = await checkMDXFiles(fullPath); | ||
if (!isValid) { | ||
allFilesValid = false; | ||
} | ||
} else if (filePattern.test(file)) { | ||
if (await shouldExcludeFile(fullPath)) { | ||
console.log(`Skipping excluded file: ${fullPath}`); | ||
continue; | ||
} | ||
const isValid = await checkDescriptionLength(fullPath); | ||
if (!isValid) { | ||
allFilesValid = false; | ||
} | ||
} | ||
} | ||
|
||
return allFilesValid; | ||
} | ||
|
||
(async () => { | ||
const allFilesValid = await checkMDXFiles(mdxDir); | ||
|
||
// Summary report | ||
console.log(`\nSummary Report:`); | ||
console.log(`Total files checked: ${totalFilesChecked}`); | ||
console.log(`Total valid files: ${totalFilesValid}`); | ||
console.log(`Total invalid files: ${totalFilesInvalid}`); | ||
|
||
if (!allFilesValid) { | ||
console.error( | ||
"Some files have invalid or missing descriptions. Meta description needing to be 50-160 characters" | ||
); | ||
process.exit(1); // Fail if any file is invalid | ||
} else { | ||
console.log( | ||
"All files have a valid description length in the frontmatter." | ||
); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: check-mdx-frontmatter | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'fern/pages/**/*.mdx' | ||
- 'fern/pages/**/**/*.mdx' | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Install Dependencies | ||
shell: bash | ||
run: pnpm install | ||
|
||
- name: Run MDX frontmatter check | ||
run: node .github/scripts/check-mdx-frontmatter.js |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"organization": "cohere", | ||
"version": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: "New Embed, Rerank, Chat, and Classify APIs" | ||
slug: "changelog/v2-api-release" | ||
createdAt: "Thurs Sept 26 2024 09:30:00 (EST)" | ||
hidden: false | ||
description: >- | ||
Introducing improvements to our Chat, Classify, Embed, and Rerank APIs in a major version upgrade, making it easier and faster to build with Cohere. | ||
--- | ||
We're excited to introduce improvements to our Chat, Classify, Embed, and Rerank APIs in a major version upgrade, making it easier and faster to build with Cohere. We are also releasing new versions of our Python, TypeScript, Java, and Go SDKs which feature `cohere.ClientV2` for access to the new API. | ||
|
||
## New at a glance | ||
* V2 Chat, Classify, Embed, and Rerank: `model` is a required parameter | ||
* V2 Embed: `embedding_types` is a required parameter | ||
* V2 Chat: Message and chat history are [combined](/v2/docs/migrating-v1-to-v2#messages-and-preamble) in a single `messages` array | ||
* V2 Chat: [Tools](/v2/docs/parameter-types-in-tool-use) are defined in JSON schema | ||
* V2 Chat: Introduces `tool_call_ids` to [match tool calls with tool results](/v2/docs/migrating-v1-to-v2#tool-call-id) | ||
* V2 Chat: `documents` [supports a list of strings or a list of objects](/v2/docs/migrating-v1-to-v2#documents) with document metadata | ||
* V2 Chat streaming: Uses [server-sent events](/v2/docs/migrating-v1-to-v2#streaming) | ||
|
||
## Other updates | ||
We are simplifying the Chat API by removing support for the following parameters available in V1: | ||
* `search_queries_only`, which generates only a search query given a user’s message input. `search_queries_only` is not supported in the V2 Chat API today, but will be supported at a later date. | ||
* `connectors`, which enables users to register a data source with Cohere for RAG queries. To use the Chat V2 API with web search, see our [migration guide](/v2/docs/migrating-v1-to-v2#) for instructios to implement a web search tool. | ||
* `conversation_id`, used to manage chat history on behalf of the developer. This will not be supported in the V2 Chat API. | ||
* `prompt_truncation`, used to automatically rerank and remove documents if the query did not fit in the model’s context limit. This will not be supported in the V2 Chat API. | ||
* `force_single_step`, which forced the model to finish tool calling in one set of turns. This will not be supported in the V2 Chat API. | ||
* `preamble`, used for giving the model task, context, and style instructions. Use a system turn at the beginning of your `messages` array in V2. | ||
* `citation_quality`, for users to select between `fast` citations, `accurate` citations (slightly higher latency than fast), or citations `off`. In V2 Chat, we are introducing a top level `citation_options` parameter for all citation settings. `citation_quality` will be replaced by a `mode` parameter within `citation_options`. | ||
|
||
|
||
See our Chat API [migration guide](/v2/docs/migrating-v1-to-v2) for detailed instructions to update your implementation. | ||
|
||
|
||
These APIs are in Beta and are subject to updates. We welcome feedback in our [Discord](https://discord.com/invite/co-mmunity) channel. | ||
|
14 changes: 14 additions & 0 deletions
14
fern/pages/changelog/2024-09-26-refresh-models-on-azure.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: "The refreshed Command R and Command R+ models are now on Azure" | ||
slug: "changelog/refresh-models-on-azure" | ||
createdAt: "Thurs Sept 24 2024" | ||
hidden: false | ||
description: >- | ||
Introducing our improved Command models are available on the Azure cloud computing platform. | ||
--- | ||
|
||
You'll recall that we [released refreshed models](https://docs.cohere.com/changelog/command-gets-refreshed) of Command R and Command R+ in August. | ||
|
||
Today, we're pleased to announce that these models are available on the Azure cloud computing platform! | ||
|
||
You can find more information about using Cohere's Command models on Azure [here](https://learn.microsoft.com/en-us/azure/ai-studio/how-to/deploy-models-cohere-command?tabs=cohere-command-r-plus&pivots=programming-language-python). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: "Fine-Tuning Now Available for Command R 08-2024" | ||
slug: "changelog/commandr-082024-ft" | ||
createdAt: "Thurs Oct 03 2024" | ||
hidden: false | ||
description: >- | ||
Launch of fine-tuning for Command R 08-2024 and other new fine-tuning features. | ||
--- | ||
|
||
Today, we're pleased to announce that fine-tuning is now available for [Command R 08-2024](/docs/command-r#command-r-august-2024-release)! | ||
|
||
We're also introducing other chat fine-tuning features: | ||
- Support for **16384 context lengths (up from 8192)** for fine-tuning training and MultiLoRA. | ||
- Integration with Weights & Biases for tracking fine-tuning experiments in real time. | ||
|
||
See the [Chat fine-tuning documentation](/docs/chat-fine-tuning) to learn more about creating a fine-tuned model. |
36 changes: 36 additions & 0 deletions
36
fern/pages/changelog/2024-10-22-Embed-v3-is-multimodal.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: "Embed v3.0 Models are now Multimodal" | ||
slug: "changelog/embed-v3-is-multimodal" | ||
createdAt: "Tues Oct 22 2024 05:30:00 (MST)" | ||
hidden: false | ||
description: >- | ||
Launch of multimodal embeddings for our Embed models, plus some code to help get started. | ||
--- | ||
|
||
Today we’re announcing updates to our embed-v3.0 family of models. These models now have the ability to process images into embeddings. There is no change to existing text capabilities which means there is no need to re-embed texts you have already processed with our `embed-v3.0` models. | ||
|
||
In the rest of these release notes, we’ll provide more details about technical enhancements, new features, and new pricing. | ||
|
||
## Technical Details | ||
### API Changes: | ||
The Embed API has two major changes: | ||
- Introduced a new `input_type` called `image` | ||
- Introduced a new parameter called `images` | ||
|
||
Example request on how to process | ||
|
||
```Text cURL | ||
POST https://api.cohere.ai/v1/embed | ||
{ | ||
"model": "embed-multilingual-v3.0", | ||
"input_type": "image", | ||
"embedding_types": ["float"], | ||
"images": [enc_img] | ||
} | ||
``` | ||
### Restrictions: | ||
- The API only accepts images in the base format of the following: `png`, `jpeg`,`Webp`, and `gif` | ||
- Image embeddings currently does not support batching so the max images sent per request is 1 | ||
- The maximum image sizez is `5mb` | ||
- The `images` parameter only accepts a base64 encoded image formatted as a Data Url | ||
|
Oops, something went wrong.