Can't enable 'text-embedding-3-large'

The following error occurs when trying to switch the embedding model from the default ‘text-embedding-ada-002’ to thr ‘text-embedding-3-large’
Error message: text-embedding-3-large’ is not a valid OpenAIEmbeddingModelType

import openai
from langchain_openai import OpenAI
from llama_index.embeddings import OpenAIEmbedding
from llama_index import ServiceContext
llm = OpenAI()
embed_model = OpenAIEmbedding(
model="text-embedding-3-large",
dimensions=512,

)
service_context = ServiceContext.from_defaults(embed_model=embed_model, llm=OpenAI())

langchain_openai

you’re not using the official openai API library! maybe it hasn’t been updated yet!

1 Like

thank you! I have tried to import from langchain and it worked, however it tuned out that ADA is more effective. The answers privided out of embeddings ‘text-embedding-3-large’ appeared to be much more irrelevant

from langchain_openai import OpenAIEmbeddings
embed_model = OpenAIEmbeddings(model="text-embedding-3-large", dimensions=1536)
1 Like

That’s interesting! What do your embedded documents look like?

ada focuses mostly on the start of the document, while text embedding 3 rips stuff out of the middle when the documents get too long.