langchain.llms.bedrock.LLMInputOutputAdapter¶
class langchain.llms.bedrock.LLMInputOutputAdapter[source]¶
Adapter class to prepare the inputs from Langchain to a format
that LLM model expects.
It also provides helper function to extract
the generated text from the model response.
Attributes
provider_to_output_key_map
Methods
__init__()
prepare_input(provider, prompt, model_kwargs)
prepare_output(provider, response)
prepare_output_stream(provider, response[, stop])
__init__()¶
classmethod prepare_input(provider: str, prompt: str, model_kwargs: Dict[str, Any]) → Dict[str, Any][source]¶
classmethod prepare_output(provider: str, response: Any) → str[source]¶
classmethod prepare_output_stream(provider: str, response: Any, stop: Optional[List[str]] = None) → Iterator[GenerationChunk][source]¶