Skip to content

Conversation

@chakravarthik27
Copy link
Collaborator

This pull request updates the OpenAI embeddings integration to use the latest API client pattern and a newer embedding model. The changes primarily modernize how the OpenAI API is called and update the default model for generating embeddings.

OpenAI API integration updates:

  • Updated the default embedding model from text-embedding-ada-002 to text-embedding-3-small in the OpenaiEmbeddings class constructor.
  • Changed API calls to use the new openai.Client class with explicit API key passing, rather than setting api_key directly on the module. This affects both batch and single text embedding requests in the get_embedding method.
  • Updated the response parsing to match the new API response structure (accessing response.data[i].embedding instead of response["data"][i]["embedding"]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants