GPTCache

Форк
0
/
check_hit.py 
20 строк · 1.1 Кб
1
# pylint: disable=unused-argument
2
def check_hit_session(cur_session_id: str, cache_session_ids: list, cache_questions: list, cache_answer: str):
3
    """
4
    Check if the sesion result meets the hit requirement.
5

6
    :param cur_session_id: the name of the current session.
7
    :type cur_session_id: str
8
    :param cache_session_ids: a list of session names for caching the same content if you are using map as a data management method.
9
                              Otherwise a list of session names for similar content and same answer.
10
    :type cache_session_ids: list
11
    :param cache_question: a list with one question which same as the you asked if you use a map as a data management method.
12
                           Otherwise it is a list that is similar to the question you asked with the same answer,
13
                           and it is correspondence with cache_session_ids.
14
    :type cache_question: list
15
    :param cache_answer: the content of the cached answer.
16
    :param cache_answer: str
17

18
    :return: True or False
19
    """
20
    return cur_session_id not in cache_session_ids
21

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.