我將向您展示如何開發系統,以優化使用上下文數據庫中人工智能應用程序中提示的使用。該項目使用Python ,DuckDB,Langchain等技術。它突出使用DuckDB作為矢量數據庫,這有助於有效地管理大型數據量,而Langchain庫則集成以探索Chatgpt-3.5或更高語言模型的功能。
通過這種集成,該項目結合了諸如嵌入和續航力的生成(RAG)之類的先進技術,展示了所涵蓋的理論概念的實用且複雜的應用。這種工具和技術的組合不僅提高了AI應用程序的準確性和效率,而且還例證了很少射擊提示的實踐,其中提示了一些示例,這些示例有助於更好地了解所要求的內容。

git clone https://github.com/Renatoelho/ContextDB.git contextDB cd contextDB/app/python3 -m venv .venv source .venv/bin/activatepip install pip setuptools wheel && pip install -r requirements.txt重要:使用OpenAI的訪問令牌更新.ENV文件,並在OpenAI開發人員平台上具有積分https://platform.openai.com/。
python3 ./app.py注意:要使用其他消息測試應用程序,只需更改app.py文件中的代金券atendimento的文本即可。
Carraro,Fabricio。人工智能和CHATGPT:從生成AI模型的革命到促進工程。 1。 Ed。 Sao Paulo:Casa Do Code Publisher,2023年。
Python DB API, DuckDB。可在以下網址找到:https://duckdb.org/docs/api/python/dbapi。訪問:2024年4月22日。
什麼是抹布? , aws。可在以下網址找到:https://aws.amazon.com/en/what-i/retieval-ugmented-generation/。訪問:2024年4月22日。
單詞嵌入:使計算機理解單詞的含義 - 非常重要的NLP概念的介紹:嵌入和word2vec,媒介。可在以下網址獲得:https://medium.com/turing-talks/word-empedding-fing-fo-fo-computer-nefing-da-da-das-lavras-92f2745057。訪問:2024年4月22日。
langchain_community.vectors.duckdb.duckdb, api python langchain。可在以下網址獲得:https://api.python.langchain.com/en/latest/vectors/langchain_community.vectors.duckdb.html。訪問:2024年4月22日。
langchain_community.embeddings.openai.openaieembeddings, openieeemeembeddings。可在以下網址獲得:https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.openai.openeeembedings.html#langchain-community-community-community-openai-openai-oppedings。訪問:2024年4月22日。