Skip to content

Commit

Permalink
restrict
Browse files Browse the repository at this point in the history
  • Loading branch information
weitsung50110 committed Nov 25, 2024
1 parent b5fc10b commit 9a29458
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions langchain_rag_doc_restrict.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# 建立文件列表,每個文件包含一段文字內容
docs = [
Document(page_content='崴寶Weibert Weiberson的網站:了解更多關於崴寶的資訊,請訪問 https://weitsung50110.github.io'),
Document(page_content='崴寶Weibert Weiberson的YouTube:觀看崴寶的最新影片,請訪問 https://youtube.com/@weibert'),
Document(page_content='崴寶Weibert Weiberson的YouTube(yt):觀看崴寶的最新影片,請訪問 https://youtube.com/@weibert'),
Document(page_content='崴寶Weibert Weiberson的Instagram(IG):跟隨崴寶的編程和創作,請訪問 https://instagram.com/weibert_coding'),
Document(page_content='崴寶Weibert Weiberson的Threads:探索崴寶的更多動態,請訪問 https://threads.net/@weibert_coding')
Document(page_content='崴寶Weibert Weiberson的Threads(脆):探索崴寶的更多動態,請訪問 https://threads.net/@weibert_coding')
]

# 設定文本分割器,chunk_size是分割的大小,chunk_overlap是重疊的部分
Expand Down Expand Up @@ -54,12 +54,12 @@
'input': input_text,
'context': context
})
print(response['answer'])
# print(response['answer'])
# context = response['context']
print("-------------------")
print(response)
# print(response)
print("-------------------")
print(response['context'])
# print(response['context'])
input_text = input('>>> ')

# https://myapollo.com.tw/blog/langchain-tutorial-retrieval/
Expand Down

0 comments on commit 9a29458

Please sign in to comment.