Inference parameters for Bedrock anthropic model showing problems with max_tokens_for_sample parameter
Labels: name: auto:bug, name: area: models

### System Info

Python 3.10.6
Langchain 0.0.220

### Who can help?

@3

### Information

- [ ] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

When I instantiate the model and chain like this:
```
llm = Bedrock(model_id="anthropic.claude-v1",
                       model_kwargs={'max_tokens_to_sample': 2048,
                                                 'temperature': 1.0,
                                                 'top_k': 250,
                                                 'top_p': 0.999,
                                                 'stop_sequences': ['Human:']},
                      client=bedrock_client)
chain = load_qa_chain(llm, chain_type='stuff', verbose=False)
```
and proceed with `chain.run(input_documents=context, question=query)`, I am getting an error when `len(context) > 50`. However, I am passing `max_tokens_to_sample = 2048`. If `len(context) < 50` it works perfectly fine. The error I am getting is:

```
Traceback (most recent call last):
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/lambdas/processQnA/trigger.py", line 59, in <module>
    main()
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/lambdas/processQnA/trigger.py", line 51, in main
    response = handle_event(q, None)
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/lambdas/processQnA/handler.py", line 92, in handle_event
    response = ask_question(embeddings, chain, indexes, question)
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/lambdas/processQnA/utils.py", line 225, in ask_question
    return chain.run(input_documents=context, question=query)
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/base.py", line 293, in run
    return self(kwargs, callbacks=callbacks, tags=tags)[_output_key]
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/base.py", line 166, in __call__
    raise e
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/base.py", line 160, in __call__
    self._call(inputs, run_manager=run_manager)
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/combine_documents/base.py", line 84, in _call
    output, extra_return_dict = self.combine_docs(
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/combine_documents/stuff.py", line 87, in combine_docs
    return self.llm_chain.predict(callbacks=callbacks, **inputs), {}
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/llm.py", line 252, in predict
    return self(kwargs, callbacks=callbacks)[self.output_key]
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/base.py", line 166, in __call__
    raise e
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/base.py", line 160, in __call__
    self._call(inputs, run_manager=run_manager)
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/llm.py", line 92, in _call
    response = self.generate([inputs], run_manager=run_manager)
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/chains/llm.py", line 102, in generate
    return self.llm.generate_prompt(
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/llms/base.py", line 141, in generate_prompt
    return self.generate(prompt_strings, stop=stop, callbacks=callbacks, **kwargs)
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/llms/base.py", line 227, in generate
    output = self._generate_helper(
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/llms/base.py", line 178, in _generate_helper
    raise e
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/llms/base.py", line 165, in _generate_helper
    self._generate(
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/llms/base.py", line 525, in _generate
    self._call(prompt, stop=stop, run_manager=run_manager, **kwargs)
  File "/home/jlopezcolmenarejo/Dev/ai-assistant-adopcat-poc/.venv/lib/python3.10/site-packages/langchain/llms/bedrock.py", line 190, in _call
    raise ValueError(f"Error raised by bedrock service: {e}")
ValueError: Error raised by bedrock service: An error occurred (ValidationException) when calling the InvokeModel operation: The provided inference configurations are invalid
```

I have checked that `bedrock.py/LLMInputOutputAdapter.prepare_input` does NOT run this: `input_body["max_tokens_to_sample"] = 50`. In fact, it just add the prompt. It returns something like:

`{'max_tokens_to_sample': 2048, 'temperature': 1.0, 'top_k': 250, 'top_p': 0.999, 'stop_sequences': ['Human:'], 'prompt': "Use the following pieces of context to answer the question at the end. Blah blah blah ...}`


### Expected behavior

No errors should be raised.