You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/experimental/langchain_experimental
Pranav Agarwal 86ae48b781
experimental[minor]: Amazon Personalize support (#17436)
## 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
7 months ago
..
agents experimental[patch]: fix zero-shot pandas agent (#17442) 7 months ago
autonomous_agents infra: add print rule to ruff (#16221) 7 months ago
chat_models
comprehend_moderation
cpal
data_anonymizer core[patch]: Support .yml extension for YAML (#16783) 7 months ago
fallacy_removal
generative_agents
graph_transformers
llm_bash
llm_symbolic_math
llms
open_clip
openai_assistant
pal_chain experimental[patch]: Enhance protection against arbitrary code execution in PALChain (#17091) 7 months ago
plan_and_execute
prompt_injection_identifier
prompts core[patch]: Support .yml extension for YAML (#16783) 7 months ago
pydantic_v1
recommenders experimental[minor]: Amazon Personalize support (#17436) 7 months ago
retrievers
rl_chain
smart_llm experimental[patch]: Fixed typos in SmartLLMChain ideation and critique prompts (#11507) 7 months ago
sql community[minor]: SQLDatabase Add fetch mode `cursor`, query parameters, query by selectable, expose execution options, and documentation (#17191) 7 months ago
synthetic_data
tabular_synthetic_data
tools
tot
utilities
__init__.py
py.typed
text_splitter.py