embedchain helloworld

支 持 本 站: 捐贈伺服器等運維費用,需要您的支持!

embedchain
1. install
export HNSWLIB_NO_NATIVE=1
pip install embedchain

# update
pip list -o
pip install -U langchain



支 持 本 站: 捐贈伺服器等運維費用,需要您的支持!

2. sample code

from embedchain import App

naval_chat_bot = App()

# Embed Online Resources
naval_chat_bot.add("youtube_video", "https://www.youtube.com/watch?v=3qHkcs3kG44")
naval_chat_bot.add("pdf_file", "https://navalmanack.s3.amazonaws.com/Eric-Jorgenson_The-Almanack-of-Naval-Ravikant_Final.pdf")
naval_chat_bot.add("web_page", "https://nav.al/feedback")
naval_chat_bot.add("web_page", "https://nav.al/agi")

# Embed Local Resources
naval_chat_bot.add_local("qna_pair", ("Who is Naval Ravikant?", "Naval Ravikant is an Indian-American entrepreneur and investor."))

naval_chat_bot.query("What unique capacity does Naval argue humans possess when it comes to understanding explanations or concepts?")
# answer: Naval argues that humans possess the unique capacity to understand explanations or concepts to the maximum extent possible in this physical reality.

支 持 本 站: 捐贈伺服器等運維費用,需要您的支持!

發布時間: