From 7cfef5a9bcb81100bcf2783ff8b00c1bd6929a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20J=C3=B8rgensen?= Date: Sun, 3 Mar 2024 22:31:21 +0100 Subject: [PATCH 1/2] set text-embedding-3-small as default for openai (#921) --- core/indexing/embeddings/OpenAIEmbeddingsProvider.ts | 2 +- docs/docs/walkthroughs/codebase-embeddings.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/indexing/embeddings/OpenAIEmbeddingsProvider.ts b/core/indexing/embeddings/OpenAIEmbeddingsProvider.ts index ce1ea2a4f..2ffed3095 100644 --- a/core/indexing/embeddings/OpenAIEmbeddingsProvider.ts +++ b/core/indexing/embeddings/OpenAIEmbeddingsProvider.ts @@ -4,7 +4,7 @@ import BaseEmbeddingsProvider from "./BaseEmbeddingsProvider"; class OpenAIEmbeddingsProvider extends BaseEmbeddingsProvider { static defaultOptions: Partial | undefined = { apiBase: "https://api.openai.com/v1", - model: "text-embedding-3-large", + model: "text-embedding-3-small", }; get id(): string { diff --git a/docs/docs/walkthroughs/codebase-embeddings.md b/docs/docs/walkthroughs/codebase-embeddings.md index b06c246ee..701100a4d 100644 --- a/docs/docs/walkthroughs/codebase-embeddings.md +++ b/docs/docs/walkthroughs/codebase-embeddings.md @@ -98,7 +98,7 @@ We also support other methods of generating embeddings, which can be configured OpenAI's [embeddings](https://platform.openai.com/docs/guides/embeddings) are high dimensional embeddings that give great performance on both text and code. -Configuration for text-embedding-3-small Model +Configuration for text-embedding-3-small Model. This is default. The text-embedding-3-small model offers an outstanding balance between performance and efficiency, suitable for a versatile range of applications. ```json title="~/.continue/config.json" From e4791023b3d28a35c88f59264d5f7ad9da5e042e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20J=C3=B8rgensen?= Date: Sun, 3 Mar 2024 22:32:43 +0100 Subject: [PATCH 2/2] Remove duplicates in this character class. (#920) --- core/indexing/chunk/markdown.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/indexing/chunk/markdown.ts b/core/indexing/chunk/markdown.ts index bad8360ea..c87f891ba 100644 --- a/core/indexing/chunk/markdown.ts +++ b/core/indexing/chunk/markdown.ts @@ -17,7 +17,7 @@ function cleanFragment(fragment: string | undefined): string | undefined { } // Remove all special characters except alphanumeric, hyphen, space, and underscore - fragment = fragment.replace(/[^\w\d-\s]/g, "").trim(); + fragment = fragment.replace(/[^\w-\s]/g, "").trim(); // Convert to lowercase fragment = fragment.toLowerCase(); @@ -43,7 +43,7 @@ function cleanHeader(header: string | undefined): string | undefined { } // Remove all special characters except alphanumeric, hyphen, space, and underscore - header = header.replace(/[^\w\d-\s]/g, "").trim(); + header = header.replace(/[^\w-\s]/g, "").trim(); return header; }