Add question caching
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
調査の方向性
提案されている chat_completion フローから始め、embedding の生成、ベクトル検索、チャット履歴、completion の生成を含む既存の RAG リクエストパスを追跡します。実装前に、キャッシュの保存方法、一致判定の動作、キャッシュヒット時の戻り値を定義します。done には、両方のパスのテストを含む、動作するキャッシュヒットとキャッシュミスを含める必要があります。
索引モデルが issue の本文から書いたものです。
説明
Description
Add a question caching feature. Pseudocode based on other repo-
def chat_completion(user_input):
# Generate embeddings from the user input
user_embeddings = generate_embeddings(openai_client, user_input)
# Query the chat history cache first to see if this question has been asked before
cache_results = cache_search(vectors=user_embeddings , num_results=1)
if len(cache_results) > 0:
return cache_results[0]['completion'], True
else:
# Perform vector search
search_results = get_similar_docs(openai_client, dbsource, user_input, 3)
print("Getting Chat History\n")
# Chat history
chat_history = get_chat_history(1)
# Generate the completion
print("Generating completions \n")
completions_results = generatecompletionede(user_input, search_results, chat_history)
# Cache the response
cacheresponse(user_input, user_embeddings, completions_results)
print("\n")
# Return the generated LLM completion
return completions_results['choices'][0]['message']['content'], False
- 主要言語
- Python
- スター
- 505
- フォーク
- 1.1k
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure-Samples/rag-postgres-openai-python のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Azure-Samples/rag-postgres-openai-python#288 · コメント 1 件 ·
-
Azure-Samples/rag-postgres-openai-python#273 · 担当者 1 名 ·
-
Azure-Samples/rag-postgres-openai-python#269 · リアクション 1 件 · 担当者 1 名 ·
-
Azure-Samples/rag-postgres-openai-python#261 · リアクション 1 件 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Azure-Samples/rag-postgres-openai-python の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
StevenBlack/hosts#3256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
qualcomm/qai-appbuilder#275 ·