fix _generate_with_cache use RedisCache raise "KeyError('message')"
Labels: name: auto:bug

Description:
This is a fix for using RedisCache raise "KeyError('message')"

Use RedisCache example:
```
import redis
import langchain
from langchain.cache import RedisCache

redis_cli = redis.Redis.from_url(url='redis://:root@localhost:16379/1')
langchain.llm_cache = RedisCache(redis_=redis_cli)
```

The following exceptions will be thrown:
```
[chain/error] [1:chain:MultiRouteChain] [2.826ms] Chain run errored with error:
"KeyError('message')"
Exception in thread Thread-11:
Traceback (most recent call last):
  File "/data/opt/anaconda3/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/data/opt/anaconda3/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/path/to/app_gradio.py", line 40, in run
    answer = chain(question)
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/base.py", line 243, in __call__
    raise e
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/base.py", line 237, in __call__
    self._call(inputs, run_manager=run_manager)
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/router/base.py", line 82, in _call
    route = self.router_chain.route(inputs, callbacks=callbacks)
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/router/base.py", line 30, in route
    result = self(inputs, callbacks=callbacks)
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/base.py", line 243, in __call__
    raise e
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/base.py", line 237, in __call__
    self._call(inputs, run_manager=run_manager)
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/router/llm_router.py", line 59, in _call
    self.llm_chain.predict_and_parse(callbacks=callbacks, **inputs),
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/llm.py", line 279, in predict_and_parse
    result = self.predict(callbacks=callbacks, **kwargs)
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/llm.py", line 252, in predict
    return self(kwargs, callbacks=callbacks)[self.output_key]
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/base.py", line 243, in __call__
    raise e
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/base.py", line 237, in __call__
    self._call(inputs, run_manager=run_manager)
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/llm.py", line 92, in _call
    response = self.generate([inputs], run_manager=run_manager)
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chains/llm.py", line 102, in generate
    return self.llm.generate_prompt(
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chat_models/base.py", line 230, in generate_prompt
    return self.generate(prompt_messages, stop=stop, callbacks=callbacks, **kwargs)
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chat_models/base.py", line 125, in generate
    raise e
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chat_models/base.py", line 115, in generate
    self._generate_with_cache(
  File "/path/to/venv/lib/python3.9/site-packages/langchain/chat_models/base.py", line 272, in _generate_with_cache
    return ChatResult(generations=cache_val)
  File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__
  File "pydantic/main.py", line 1076, in pydantic.main.validate_model
  File "pydantic/fields.py", line 895, in pydantic.fields.ModelField.validate
  File "pydantic/fields.py", line 928, in pydantic.fields.ModelField._validate_sequence_like
  File "pydantic/fields.py", line 1094, in pydantic.fields.ModelField._validate_singleton
  File "pydantic/fields.py", line 884, in pydantic.fields.ModelField.validate
  File "pydantic/fields.py", line 1101, in pydantic.fields.ModelField._validate_singleton
  File "pydantic/fields.py", line 1157, in pydantic.fields.ModelField._apply_validators
  File "pydantic/class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13
  File "pydantic/main.py", line 719, in pydantic.main.BaseModel.validate
  File "/path/to/venv/lib/python3.9/site-packages/langchain/load/serializable.py", line 74, in __init__
    super().__init__(**kwargs)
  File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__
  File "pydantic/main.py", line 1102, in pydantic.main.validate_model
  File "/path/to/venv/lib/python3.9/site-packages/langchain/schema/output.py", line 42, in set_text
    values["text"] = values["message"].content
KeyError: 'message'
```

This commit is to fix this bug.