Closed spacepirate0001 closed 1 month ago
here is the full log in case its useful!
Invoking model_2 with 'What is 1+1?'
Result: content='1+1 equals 2.' additional_kwargs={'refusal': None} response_metadata={'token_usage': {'completion_tokens': 7, 'prompt_tokens': 14, 'total_tokens': 21, 'completion_tokens_details': None}, 'model_name': 'gpt-35-turbo-16k', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None, 'content_filter_results': {}} id='run-5f88e392-131e-45d4-a55b-f009ae0887ac-0' usage_metadata={'input_tokens': 14, 'output_tokens': 7, 'total_tokens': 21}
Time taken: 0.94 seconds
Current cache contents:
Key: llmcache:cfbba30096aef098692dfd596bfe8caa01e49dc95fa8285f529fd762090b0050, Type: hash, Value: <hash type>
==================================================
Invoking model_2 with 'Tell me one joke'
Result: content='1+1 equals 2.' additional_kwargs={'refusal': None} response_metadata={'token_usage': {'completion_tokens': 7, 'prompt_tokens': 14, 'total_tokens': 21, 'completion_tokens_details': None}, 'model_name': 'gpt-35-turbo-16k', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None, 'content_filter_results': {}} id='run-5f88e392-131e-45d4-a55b-f009ae0887ac-0' usage_metadata={'input_tokens': 14, 'output_tokens': 7, 'total_tokens': 21}
Time taken: 0.56 seconds
Current cache contents:
Key: llmcache:cfbba30096aef098692dfd596bfe8caa01e49dc95fa8285f529fd762090b0050, Type: hash, Value: <hash type>
==================================================
Invoking model_2 with 'What is 21+1?'
Result: content='1+1 equals 2.' additional_kwargs={'refusal': None} response_metadata={'token_usage': {'completion_tokens': 7, 'prompt_tokens': 14, 'total_tokens': 21, 'completion_tokens_details': None}, 'model_name': 'gpt-35-turbo-16k', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None, 'content_filter_results': {}} id='run-5f88e392-131e-45d4-a55b-f009ae0887ac-0' usage_metadata={'input_tokens': 14, 'output_tokens': 7, 'total_tokens': 21}
Time taken: 0.17 seconds
Current cache contents:
Key: llmcache:cfbba30096aef098692dfd596bfe8caa01e49dc95fa8285f529fd762090b0050, Type: hash, Value: <hash type>
==================================================
Invoking model_2 with 'What is 1+1?'
Result: content='1+1 equals 2.' additional_kwargs={'refusal': None} response_metadata={'token_usage': {'completion_tokens': 7, 'prompt_tokens': 14, 'total_tokens': 21, 'completion_tokens_details': None}, 'model_name': 'gpt-35-turbo-16k', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None, 'content_filter_results': {}} id='run-5f88e392-131e-45d4-a55b-f009ae0887ac-0' usage_metadata={'input_tokens': 14, 'output_tokens': 7, 'total_tokens': 21}Time taken: 0.17 seconds
Current cache contents:
Key: llmcache:cfbba30096aef098692dfd596bfe8caa01e49dc95fa8285f529fd762090b0050, Type: hash, Value: <hash type>
==================================================
After adjusting distance_threshold
all works as expected!
@spacepirate0001 glad you got it working!
I've run into an interesting issue while testing RedisSemanticCache, and I'm hoping someone can shed some light on whether this is expected behavior or potentially a bug.
Setup:
Observed Behavior:
Pip List:
Code Snippet:
Output Highlights:
Key: llmcache:cfbba30096aef098692dfd596bfe8caa01e49dc95fa8285f529fd762090b0050, Type: hash, Value: <hash type>
Questions:
I'd greatly appreciate any insights or suggestions on how to properly implement and utilize RedisSemanticCache. Thanks in advance for your help!