fix redis/base.py result.content to result.prompt
Labels: name: area: vector store, name: auto:bug, name: integration: redis


  - **Description:** fix redis/base.py `result.content` to `result.prompt`
  - **Issue:** AttributeError: 'Document' object has no attribute 'content'
  - **Dependencies:** None
  
Code
```python
...
# llm = GooglePalm(...)
# embedding = GooglePalmEmbeddings(...)
llm = OpenAI(...)
embedding = OpenAIEmbeddings(...)

redis_cache = RedisSemanticCache(
    redis_url="redis://...:6379", 
    embedding=embedding,
    score_threshold=0.01
)
langchain.llm_cache = redis_cache
...
langchain.llm_cache._cache_dict['...'].similarity_search_with_score(query="hello world")`
```

🛑Debug in LangChain src code:
![source](https://github.com/langchain-ai/langchain/assets/30204682/54563ac8-4a61-4fa0-93e6-8b1d4a904ca6)

❌Error(OpenAI and PaLM both) and print debug log:
![openai](https://github.com/langchain-ai/langchain/assets/30204682/ccb6a402-01d7-4dfb-98b3-6e0b5576d46b)




✅**Success and output result shape after the fix(`result.content` to `result.prompt`)**:
```python
# PaLM
[(Document(page_content='hello world', metadata={'id': 'doc:cache:4d4460ad591fb739063de9681c18b075:d4e9339a552a4b2aaf936da3fcdb2f5f', 'return_val': '[{"lc": 1, "type": "constructor", "id": ["langchain", "schema", "output", "Generation"], "kwargs": {"text": "```\\n#include <stdio.h>\\n\\nint main() {\\n  printf(\\"Hello, world!\\\\n\\");\\n  return 0;\\n}\\n```"}}]', 'llm_string': "[('_type', 'google_palm'), ('stop', None)]"}),
  0.0),
 (Document(page_content='reverse the word: hello', metadata={'id': 'doc:cache:4d4460ad591fb739063de9681c18b075:d55bc99d03f946f3a7dc4e1cf363dc23', 'return_val': '[{"lc": 1, "type": "constructor", "id": ["langchain", "schema", "output", "Generation"], "kwargs": {"text": "```\\nolleh\\n```"}}]', 'llm_string': "[('_type', 'google_palm'), ('stop', None)]"}),
  0.2481), ...]
```
```python
# OpenAI
[(Document(page_content='hello world', metadata={'id': 'doc:cache:f4d6fdd07c9be488b08c67b57ea4744c:ecc00d18e86a426190b8ed719f41da95', 'return_val': '[{"lc": 1, "type": "constructor", "id": ["langchain", "schema", "output", "Generation"], "kwargs": {"text": "\\n\\nHello world is a common phrase used to express a greeting or acknowledgment of someone or something. It is often used as a friendly greeting when meeting someone for the first time.", "generation_info": {"finish_reason": "stop", "logprobs": null}}}]', 'llm_string': "[('_type', 'openai'), ('frequency_penalty', 0), ('logit_bias', {}), ('max_tokens', 256), ('model_name', 'text-davinci-003'), ('n', 1), ('presence_penalty', 0), ('request_timeout', None), ('stop', None), ('temperature', 0.7), ('top_p', 1)]"}),
  0.0),
 (Document(page_content='reverse the word: hello', metadata={'id': 'doc:cache:f4d6fdd07c9be488b08c67b57ea4744c:d8314c01a7454f6ebf02253f238269c8', 'return_val': '[{"lc": 1, "type": "constructor", "id": ["langchain", "schema", "output", "Generation"], "kwargs": {"text": "\\n\\nolleh", "generation_info": {"finish_reason": "stop", "logprobs": null}}}]', 'llm_string': "[('_type', 'openai'), ('frequency_penalty', 0), ('logit_bias', {}), ('max_tokens', 256), ('model_name', 'text-davinci-003'), ('n', 1), ('presence_penalty', 0), ('request_timeout', None), ('stop', None), ('temperature', 0.7), ('top_p', 1)]"}),
  0.1373),...]
```