langchain-ai / rag-from-scratch

1.63k stars 453 forks source link

Add support for Gemini API keys #21

Open thenaivekid opened 1 month ago

thenaivekid commented 1 month ago

Title: Add Support for Gemini API Keys Description: This pull request introduces support for using Gemini API keys as an alternative to OpenAI API keys in the RAG project. This change aims to make the project more accessible by allowing users to utilize free Gemini keys, thus eliminating the need for paid OpenAI keys.

Changes: Replaced instances of OpenAI API key usage with Gemini API key integration. Updated relevant parts of the codebase to ensure compatibility with Gemini API. Modified documentation to include instructions for obtaining and using Gemini API keys. Testing: Conducted tests to verify that the modified code works seamlessly with Gemini API keys. Ensured no functionality is lost when using the alternative API. Benefits: Expands accessibility for users, particularly those without the means to purchase OpenAI API keys. Encourages broader experimentation and learning within the community.

Recommendation if gemini doesnot work for routing you can use cohere command r for free