π Introduction to new functions of GPTCache
1. Process the dialog context through the context processing interface, which currently supports two ways: summarize and selective context
python
import transformers
from gptcache.processor.context.summarization_context import SummarizationContextProcess
from gptcache.processor.context.selective_context import SelectiveContextProcess
from gptcache import cache
summarizer = transformers.pipeline("summarization", model="facebook/bart-large-cnn")
context_process = SummarizationContextProcess(summarizer, None, 512)
cache.init(
pre_embedding_func=context_process.pre_process,
)
context_processor = SelectiveContextProcess()
cache.init(
pre_embedding_func=context_process.pre_process,
)
What's Changed
* Add SummarizationContextProcess by wxywb in https://github.com/zilliztech/GPTCache/pull/316
* Support duckdb by SimFG in https://github.com/zilliztech/GPTCache/pull/323
* Add cmd for gptcache server by Chiiizzzy in https://github.com/zilliztech/GPTCache/pull/325
* Support the selective context processor by SimFG in https://github.com/zilliztech/GPTCache/pull/326
**Full Changelog**: https://github.com/zilliztech/GPTCache/compare/0.1.21...0.1.22