From 5144908d1a468fb3307f3cd74496d5a39d674a37 Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:06:02 +0100 Subject: [PATCH] chore(ai-help): stop generating ada embeddings (#11630) --- scripts/ai-help-macros.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ai-help-macros.ts b/scripts/ai-help-macros.ts index a7a7f19c03a2..d2cea614d758 100644 --- a/scripts/ai-help-macros.ts +++ b/scripts/ai-help-macros.ts @@ -22,7 +22,7 @@ import { } from "@mdn/browser-compat-data/types"; import { h2mSync } from "../markdown/index.js"; -const EMBEDDING_MODEL = "text-embedding-ada-002"; +const EMBEDDING_MODEL = "text-embedding-3-small"; const EMBEDDING_MODEL_NEXT = "text-embedding-3-small"; const { program } = caporal; @@ -214,7 +214,7 @@ export async function updateEmbeddings( const [{ total_tokens, embedding }, embedding_next] = await Promise.all( [ createEmbedding(text, EMBEDDING_MODEL), - EMBEDDING_MODEL_NEXT + EMBEDDING_MODEL_NEXT && EMBEDDING_MODEL_NEXT !== EMBEDDING_MODEL ? createEmbedding(text, EMBEDDING_MODEL_NEXT).then( ({ embedding }) => embedding ) @@ -257,7 +257,7 @@ export async function updateEmbeddings( markdown_hash, total_tokens, pgvector.toSql(embedding), - embedding_next ? pgvector.toSql(embedding_next) : null, + pgvector.toSql(embedding_next ?? embedding), text_hash, ], rowMode: "array",