zilliztech / GPTCache

Semantic cache for LLMs. Fully integrated with LangChain and llama_index.
https://gptcache.readthedocs.io
MIT License
6.89k stars 480 forks source link

Add Nomic embedding integration #610

Closed sky-2002 closed 4 months ago

sky-2002 commented 4 months ago

This PR adds integration of embeddings with Nomic.

Example usage:

from gptcache.embedding import Nomic

test_sentence = 'Hey this is Nomic embedding integration to gptcache.'
encoder = Nomic(model='nomic-embed-text-v1.5', 
                            api_key='<your-nomic-api-key>', 
                            dimensionality=64)
embed = encoder.to_embeddings(test_sentence)

Note: I have tested this functionality and it works as intended. Looking forward for review/feedback.

sre-ci-robot commented 4 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sky-2002 To complete the pull request process, please assign xiaofan-luan after the PR has been reviewed. You can assign the PR to them by writing /assign @xiaofan-luan in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/zilliztech/GPTCache/blob/dev/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment