Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] search only operation support #445

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gptcache/adapter/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def adapt(llm_handler, cache_data_convert, update_cache_callback, *args, **kwarg
:param kwargs: llm kwargs
:return: llm result
"""
search_only_flag = kwargs.pop("search_only", False)
user_temperature = "temperature" in kwargs
user_top_k = "top_k" in kwargs
temperature = kwargs.pop("temperature", 0.0)
Expand Down Expand Up @@ -191,6 +192,9 @@ def post_process():
llm_handler, cache_data_convert, update_cache_callback, *args, **kwargs
)
else:
if search_only_flag:
# cache miss
return None
llm_data = time_cal(
llm_handler, func_name="llm_request", report_func=chat_cache.report.llm
)(*args, **kwargs)
Expand Down