From 92be66eabb8539e3cf1e14668e111836d84221d8 Mon Sep 17 00:00:00 2001 From: SimFG Date: Sun, 7 May 2023 14:40:05 +0800 Subject: [PATCH] Update the version to `0.1.22` Signed-off-by: SimFG --- docs/release_note.md | 22 ++++++++++++++++++++++ setup.py | 5 +++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/release_note.md b/docs/release_note.md index 48ac439a..66ca7d60 100644 --- a/docs/release_note.md +++ b/docs/release_note.md @@ -5,6 +5,28 @@ To read the following content, you need to understand the basic use of GPTCache, - [Readme doc](https://github.com/zilliztech/GPTCache) - [Usage doc](https://github.com/zilliztech/GPTCache/blob/main/docs/usage.md) +## v0.1.22 (2023.5.7) + +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, +) +``` + ## v0.1.21 (2023.4.29) 1. Support the temperature param diff --git a/setup.py b/setup.py index 67f5c9ed..9afffe52 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ +from typing import List + import setuptools from setuptools import find_packages -from typing import List with open("README.md", "r") as fh: long_description = fh.read() @@ -17,7 +18,7 @@ def parse_requirements(file_name: str) -> List[str]: setuptools.setup( name="gptcache", packages=find_packages(), - version="0.1.21", + version="0.1.22", author="SimFG", author_email="bang.fu@zilliz.com", description="GPTCache, a powerful caching library that can be used to speed up and lower the cost of chat "