langchain 开放搜索抹布
1.0.0
创建 Amazon OpenSearch Serverless 集合(输入Vector search并选择轻松创建选项)- 文档。
使用以下配置创建索引:
下载亚马逊 2022 年致股东信并将其放在同一目录中。
创建.env
文件并提供有关您的 Amazon OpenSearch 设置的以下信息:
opensearch_index_name= ' '
opensearch_url= ' '
engine= ' faiss '
vector_field= ' vector_field '
text_field= ' text '
metadata_field= ' metadata '
确保您已配置 Amazon Bedrock 以便从本地计算机进行访问。此外,您还需要访问 Amazon Bedrock 中的amazon.titan-embed-text-v1
嵌入模型和anthropic.claude-v2
模型 - 请按照以下说明了解详细信息。
加载PDF数据:
python3 -m venv myenv
source myenv/bin/activate
pip3 install -r requirements.txt
python3 load.py
验证 OpenSearch 集合中的数据
streamlit run app_semantic_search.py --server.port 8080
您可以提出问题,例如:
What is Amazon ' s doing in the field of generative AI?
What were the key challenges Amazon faced in 2022?
What were some of the important investments and initiatives mentioned in the letter?
在不同的终端中:
source myenv/bin/activate
streamlit run app_rag.py --server.port 8081
您可以提出问题,例如:
What is Amazon ' s doing in the field of generative AI?
What were the key challenges Amazon faced in 2022?
What were some of the important investments and initiatives mentioned in the letter?