File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/services/code-index/embedders Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,12 @@ export class OpenAICompatibleEmbedder implements IEmbedder {
111111 const response = await this . embeddingsClient . embeddings . create ( {
112112 input : batchTexts ,
113113 model : model ,
114- encoding_format : "base64" , // Use base64 to protect embedding dimensions from openai sabotage
114+ // The OpenAI package has custom parsing that truncates embedding dimension to 256,
115+ // which destroys accuracy.
116+ // If we pass `encoding_format: "base64"`, it does not perform any parsing,
117+ // leaving parsing up to us. This is likely a bug in the OpenAI package, possibly
118+ // addressed by https://github.com/openai/openai-node/pull/1448 (but maybe not)
119+ encoding_format : "base64" ,
115120 } )
116121
117122 // Convert base64 embeddings to float32 arrays
You can’t perform that action at this time.
0 commit comments