mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
86ae48b781
## Amazon Personalize support on Langchain This PR is a successor to this PR - https://github.com/langchain-ai/langchain/pull/13216 This PR introduces an integration with [Amazon Personalize](https://aws.amazon.com/personalize/) to help you to retrieve recommendations and use them in your natural language applications. This integration provides two new components: 1. An `AmazonPersonalize` client, that provides a wrapper around the Amazon Personalize API. 2. An `AmazonPersonalizeChain`, that provides a chain to pull in recommendations using the client, and then generating the response in natural language. We have added this to langchain_experimental since there was feedback from the previous PR about having this support in experimental rather than the core or community extensions. Here is some sample code to explain the usage. ```python from langchain_experimental.recommenders import AmazonPersonalize from langchain_experimental.recommenders import AmazonPersonalizeChain from langchain.llms.bedrock import Bedrock recommender_arn = "<insert_arn>" client=AmazonPersonalize( credentials_profile_name="default", region_name="us-west-2", recommender_arn=recommender_arn ) bedrock_llm = Bedrock( model_id="anthropic.claude-v2", region_name="us-west-2" ) chain = AmazonPersonalizeChain.from_llm( llm=bedrock_llm, client=client ) response = chain({'user_id': '1'}) ``` Reviewer: @3coins |
||
---|---|---|
.. | ||
agents | ||
autonomous_agents | ||
chat_models | ||
comprehend_moderation | ||
cpal | ||
data_anonymizer | ||
fallacy_removal | ||
generative_agents | ||
graph_transformers | ||
llm_bash | ||
llm_symbolic_math | ||
llms | ||
open_clip | ||
openai_assistant | ||
pal_chain | ||
plan_and_execute | ||
prompt_injection_identifier | ||
prompts | ||
pydantic_v1 | ||
recommenders | ||
retrievers | ||
rl_chain | ||
smart_llm | ||
sql | ||
synthetic_data | ||
tabular_synthetic_data | ||
tools | ||
tot | ||
utilities | ||
__init__.py | ||
py.typed | ||
text_splitter.py |