Skip to content

Commit

Permalink
Merge pull request #48 from aws-samples/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
MithilShah authored Oct 4, 2023
2 parents 18ca7aa + a38aac0 commit cd41b44
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions kendra_retriever_samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ conda env create -f environment.yml
```

### For Bedrock
If you are using Bedrock, make sure that you have a boto3 client with bedrock library and you use an AWS_PROFILE that has access to bedrock.
If you are using Bedrock, make sure that you update to the latest boto3 and langchain version with bedrock support and you use an AWS_PROFILE that has access to bedrock.

```
wget https://xxxxx/Documentation/SDK/bedrock-python-sdk.zip
unzip bedrock-python-sdk.zip
pip install *.whl
pip install --force-reinstall "langchain>=0.0.306"
pip install --force-reinstall "boto3>=1.28.57"
```

## Running samples
Expand Down Expand Up @@ -93,7 +92,7 @@ python <sample-file-name.py>

## Contributing
Create your fork and submit your changes via a pull request.
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
See [CONTRIBUTING](../CONTRIBUTING.md) for more information.

## License
This library is licensed under the MIT-0 License. See the LICENSE file.
Expand Down
12 changes: 6 additions & 6 deletions kendra_retriever_samples/kendra_chat_bedrock_claudev2.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ def build_chain():
template=prompt_template, input_variables=["context", "question"]
)

condense_qa_template = """Human:
Given the following conversation and a follow up question, rephrase the follow up question
condense_qa_template = """{chat_history}
Human:
Given the previous conversation and a follow up question below, rephrase the follow up question
to be a standalone question.
Chat History:
{chat_history}
Follow Up Input: {question}
Standalone question:
Follow Up Question: {question}
Standalone Question:
Assistant:"""
standalone_question_prompt = PromptTemplate.from_template(condense_qa_template)
Expand Down
2 changes: 1 addition & 1 deletion kendra_retriever_samples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
langchain==0.0.279
langchain==0.0.306
boto3>=1.28.27
openai
anthropic
Expand Down

0 comments on commit cd41b44

Please sign in to comment.