国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ??? ?? ??? ???? ??? AI RAG ?? ???: LangChain? ??? Python ???

??? AI RAG ?? ???: LangChain? ??? Python ???

Oct 20, 2024 pm 02:15 PM

???? ???? ??? ??? ?? ??? ?? ?????? ??? ?? RAG ??? ?? ????. ??? ??? ??? ?? ??? AI ??? ?????!

? ?????? LangChain ? Streamlit? ?? RAG(Retrieval-Augmented Generation)? ???? ??? ??? ??? ?? ??????. ? ??? ?? ???? ?? ??? ???? ?? ??? ???? ??? ?????.

OpenAI, Gemini, Fireworks ? ??? ???? ?? ??? ?? ??? ??? ????? ? ??? ??? ????. ?? ???? ??????.

?? ?? ??(RAG)?? ??????

RAG? ??? ??? ???? ?? ???? ??? ?? ?? ??? ???? ?????. ?? ????? ?? ???? ?? ??? ???? ??, ?? ????? ?? ??? ???? ??? ???? ???? ??? ??? ?????. ?? ?? ?? ?? ??? ?? ??? ?? ??? ???? ?? ???? ??? ?? ???? ???? ??? ?? ? ????.

??? ??? ?? ?? ?? ?? ??? ?? ??? ??? ??? ????. ??? ??? ?? ?? ?? ?? ??? ????(??), ? ??? ???? ??? ?? ?? ????(??). ??? ????? ? ?? ??? ??? RAG? ?? ?????.

????? RAG ????? ??? ????.

Create Your Own AI RAG Chatbot: A Python Guide with LangChain

?? ??? ???. ??? ??? ??????!


???? ?? ??

? TUTO??? ?? Python? ??? ????. JS ???? ??? ??? langchain js? ??? ??? ? ????.

?? ???? ??? ???? ???. ???? ???? ???? ??, ??? ??, ??? ?? ??? ?? API ? ??? ?????.

1. ???? ?? ? ?? ?? ??

???? ??? ?? ??? ??? ??? ?????.

mkdir rag-chatbot
cd rag-chatbot
python -m venv venv
source venv/bin/activate

2. ??? ??

???? ??? ?? ???? ???? ?? ??.txt ??? ????.

langchain==0.0.329
streamlit==1.27.2
faiss-cpu==1.7.4
python-dotenv==1.0.0
tiktoken==0.5.1
openai==0.27.10
gemini==0.3.1
fireworks==0.4.0
sentence_transformers==2.2.2

?? ?? ?? ??? ?????.

pip install -r requirements.txt

3. API ? ??

??? ?? ??? ?? OpenAI, Gemini ?? Fireworks? ??? ?????. ??? ???? ?? ?? ? ??? ??? ? ????.

?? ???? ???? ???. Fireworks? 1?? ??? API ?? ??? ????, gemini-1.5-flash ??? ?? ?? ?????!

??? ??? API ?? ??? .env ??? ?????.

mkdir rag-chatbot
cd rag-chatbot
python -m venv venv
source venv/bin/activate

??? ???? ???? API ?? ????. Gemini? Fireworks? ?? ?? ??? ???? ??, OpenAI? ???? ?? ??? ?????.


?? ?? ? ??

??? ????? ????? ??? ???? ?? ??? ???? ???? ???. ?? ? ???? ?? ? ???? ???? ?? ??? ?? ?????.

1. document_processor.py ??

?? ??? ???? ?? document_processor.py?? ? Python ????? ????.

langchain==0.0.329
streamlit==1.27.2
faiss-cpu==1.7.4
python-dotenv==1.0.0
tiktoken==0.5.1
openai==0.27.10
gemini==0.3.1
fireworks==0.4.0
sentence_transformers==2.2.2

? ????? ??? ??? ???? ?? ?? ????? ???? ??? ??? ??? ??? ???? ? 1000?? ?? ??? ?????. ??? ???? ??? ???? ???? ? ????.


??? ? ??? ??

?? ??? ??????? ?? ??? ?? ???(???? ?? ??)?? ???? ?? ??? ?? ??? ???? ????. (??? ??? ??? ? ?? ???? ????)

1. embedding_indexer.py ??

embedding_indexer.py?? ? ?? ????? ????.

pip install -r requirements.txt

? ??????? ?? ?? ??(all-MiniLM-L6-v2)? ???? ???? ?????. ?? ?? ??? ???? FAISS ?? ???? ???? ??? ???? ??? ??? ??? ??? ??? ? ????.


?? ? ?? ?? ??

??? ???? ??? ????. ??? ?? ??? ???? ????! ?? ?? ????? ?? ??? ???? ?? ??? ???? ??? ???? RAG ??? ????. (?????? ??? ??? ???? ??? ??? ?????????)

1. rag_chain.py ??

rag_chain.py ??? ??? ?????:

# Uncomment your API key
# OPENAI_API_KEY=your_openai_api_key_here
# GEMINI_API_KEY=your_gemini_api_key_here
# FIREWORKS_API_KEY=your_fireworks_api_key_here

????? ??? ??? API ?? ?? OpenAI, Gemini ?? Fireworks ??? ??? ? ????. RAG ??? ?? ???? ?? ?? 3? ??? ???? ?? ??? ???? ??? ?????.

???? ?? ??? ?? ??? ??? ? ????. Gemini? Fireworks? ????, OpenAI? ???? ?? ??? ?????.


?? ????? ??

?? RAG ??? ???? ??? ??? ?? ??? ???? ??? ?? ?????? ???????.

1. chatbot.py ???

chatbot.py?? ? ??? ????.

mkdir rag-chatbot
cd rag-chatbot
python -m venv venv
source venv/bin/activate

? ????? ??? ??? ????? ???? ?? RAG ??? ?? ??? ? ??? ??? ???? ??? ?? ?????? ?????.


Streamlit UI ???

?? Streamlit? ???? ? ?????? ???? ??? ?? ??? ????? ?? ?????. ?? ?? ???? ????? ?? ??? ?? ??? ? ????.

1. app.py ??

app.py ???:

langchain==0.0.329
streamlit==1.27.2
faiss-cpu==1.7.4
python-dotenv==1.0.0
tiktoken==0.5.1
openai==0.27.10
gemini==0.3.1
fireworks==0.4.0
sentence_transformers==2.2.2

2. Streamlit ? ??

Streamlit ?? ????? ??? ?????.

pip install -r requirements.txt

??? ??? ?????, ????, ?????? ??? ?? ? ?? ? ?????? ?????.


?? ???

? ?? ??? ?? ???? ??? ? ?? ??? ??? ??? ? ? ????. ??? ??? ? ?? ????? ????? ??? ???? ?? ??? ??? ? ????. ?????? ??? ???? ??? ??? ?? ??? ?? ?? ??? ???? ??? ???.

??? ?????? ?? ???? ?? OpenAI, Gemini ?? Fireworks ?? ??? ? ????. OpenAI ??? ???? Gemini ?? ????? ???? ??? ?????.


???

?????! ???? RAG ?? ??? ????? ??????. ?? ???? ???????.

    ??? ??? ??? ???? ??????.
  • ? ?? ? ??? ??? ??? ????. "RAG it out"? ?? ??? ??? ??? ?? ? ????!
??? ??? ???? ???? ?????!


GitHub?? ? ??? ???? ? ????. ???? ?????. ? DM? X? LinkedIn?? ?? ??????.

? ??? ??? AI RAG ?? ???: LangChain? ??? Python ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

?? ??

?? : ????? ????? ??
4 ? ? ? By DDD
?? ?? ??
3 ? ? ? By Jack chen
???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

?? ????
1787
16
Cakephp ????
1730
56
??? ????
1582
29
PHP ????
1451
31
???
??? ???? ??? ??? ???? ??? Jul 05, 2025 am 02:58 AM

???? Python ?? ?? ?????? ?? ????, "??? ?????, ?? ??"? ???? ??? ??? ??? ?? ??? ?????. 1. ???? ?? ? ??? ?? ?????. ?? ???? ?? ??? ???? ??? ? ? ????. ?? ??, Spoke () ?? ???? ??? ??? ?? ??? ?? ????? ?? ??? ??? ????. 2. ???? ?? ???? ??? ??? ?????? Draw () ???? ???? ????? ?? ???? ?? ??? ???? ??? ???? ?? ?? ?? ??? ????? ?? ?? ????? ?? ?????. 3. Python ?? ???? ???????. ?? ???? ??? ???? ?? ???? ??? ????? ??? ?? ???? ??? ???? ????. ??? ??? ??? ???? ? ??? "?? ??"??????. 4. ???? ? ???? ?? ??? ?????

????? ??? ???? ??? ?????? ????? ??? ???? ??? ?????? Jun 21, 2025 am 01:02 AM

??? ???? ????? Python? Random ? String ?? ??? ??? ? ????. ?? ??? ??? ????. 1. ?? ? ??? ?? ?? ??; 2. String.ascii_letters ? String.Digits? ?? ?? ?? ?????. 3. ??? ??? ??????. 4. random.choices ()? ???? ???? ?????. ?? ??, ???? importrandom ? importString, set length = 10, arribution = string.ascii_letters.digits and execute '.join (random.c

??? '?????, ??!' Python? ????? ??? '?????, ??!' Python? ????? Jun 24, 2025 am 12:45 AM

"?????, ??!" ????? Python?? ??? ?? ???? ????.? ?? ?? ??? ???? ?? ??? ???? ???? ??? ???? ? ?????. 1. ?? ?? ?? ( "Hello, World!")? ?? ????, ?? ? ??? ???? ???? ?????. 2. ?? ???? Python ??, ??? ???? ?? ?? ??, .py ??? ??, ????? ??? ???? ?? ?????. 3. ???? ???? ?? ? ?? ? ???, ?? ?? ??, .py ???? ???? ?? ?? ?? ??? ?????. 4. ?? ???? ?? ??? ??? ???, ??? ??? (? : Replit.com)? ?????.

???? ????? ???? ? ????? ???? ????? ???? ? ????? Jun 24, 2025 am 12:43 AM

AlgorithmsinpythonaresentialsectiveFficiTuction-SolvingInprogramming

Python? ?? ????? ?????? Python? ?? ????? ?????? Jun 29, 2025 am 02:15 AM

ListSlicingInpyTonextractSapalistusingIndices.1.itusesthesyntaxlist [start : end : step], wherestartisinclusive, endisexclusive, andstepdefinestheinterval.2.ifstartorendareomitted, pythondefaultstothebeginningorendofthtlist.3

Python`@classmethod` ?????? ?????? Python`@classmethod` ?????? ?????? Jul 04, 2025 am 03:26 AM

??? ???? @ClassMethod ?????? ?? ????? ?? ? ??????. ? ?? ?? ??? ??? ?? (CLS)?? ??? ??? ?????? ???? ? ?????. ?? ????? ?? ?? ???? ??? ??? ??? ?? ????? ?? ?? ? ? ????. ?? ??, ?? ????? show_count () ???? ?? ? ?? ?? ?????. ??? ???? ?? ? ?? @ClassMethod ?????? ???? ??? ??? ???? ?? Change_var (new_value) ???? ?? ? ?? ?? ?? CLS? ???????. ??? ???? ???? ?? (?? ?? ??) ? ?? ??? (?? ?? ?? ??)? ??? ?? ??, ?? ??? ? ??? ?? ??? ?????. ???? ??? ??? ????.

Python?? CSV ??? ???? ?? CSV ??? ??? ?????? Python?? CSV ??? ???? ?? CSV ??? ??? ?????? Jun 25, 2025 am 01:03 AM

Python? CSV ??? CSV ??? ?? ?? ?? ??? ?????. 1. CSV ??? ?? ? CSV.Reader ()? ???? ? ?? ?? ? ??? ??? ??? ???? ?? ? ? ????. ? ??? ?? ???? ??? ???? ?? csv.dictreader ()? ???? ? ?? ??? ?? ? ? ????. 2. CSV ??? ? ? CSV.writer ()? ???? Writerow () ?? Writerows () ???? ???? ?? ?? ?? ?? ???? ??????. ?? ???? ????? CSV.DictWriter ()? ????? ?? ? ??? ???? writeHeader ()? ?? ??? ???????. 3. ?? ???? ?? ? ? ??? ???? ?????.

??? ?? ?? ? ?? ?? ??? ?? ?? ? ?? ?? Jul 04, 2025 am 03:26 AM

?? ??? ??? ?? ? ? ?? ?? ??? ??? ?? ? ? ?? ?? ?????. 1. ?? ?? ??? ???? ??????, ??? ??? ???? ??? ?????. 2. ??? ?? ??? ?? ?? ???? ???? ??? ???? ???? ???? ? ????. 3. ?? ?? ?? ?? ?? ??? ??? ?? ?? ? ? ????? ?? ??? ????? ??????. 4. Args? *Kwargs? ???? ?? ?? ??? ?? ? ? ????? ???? ????? ?? ?????? ????? ???? ???? ?????? ???????.

See all articles