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?