🎉 Introduction to new functions of GPTCache
- Support the langchain embedding
from gptcache.embedding import LangChain
from langchain.embeddings.openai import OpenAIEmbeddings
test_sentence = 'Hello, world.'
embeddings = OpenAIEmbeddings(model="your-embeddings-deployment-name")
encoder = LangChain(embeddings=embeddings)
embed = encoder.to_embeddings(test_sentence)
- Add gptcache client
from gptcache import Client
client = Client()
client.put("Hi", "Hi back")
ans = client.get("Hi")
- Support pgvector as vector store
from gptcache.manager import manager_factory
data_manager = manager_factory("sqlite,pgvector", vector_params={"dimension": 10})
- Add the GPTCache server doc
reference: https://github.com/zilliztech/GPTCache/blob/main/docs/usage.md#Build-GPTCache-server
What's Changed
Full Changelog: 0.1.23...0.1.24