Skip to content

Commit

Permalink
fix: system prompt to correct in rag.py
Browse files Browse the repository at this point in the history
fix JSON format key
- score to relevance_score
  • Loading branch information
sts07142 authored and Umpire2018 committed Aug 4, 2024
1 parent f64c9aa commit e559bf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion repo_agent/chat_with_repo/rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def rerank(self, query ,docs): # 这里要防止返回值格式上出问题
response_format={"type": "json_object"},
temperature=0,
messages=[
{"role": "system", "content": "You are an expert relevance ranker. Given a list of documents and a query, your job is to determine how relevant each document is for answering the query. Your output is JSON, which is a list of documents. Each document has two fields, content and score. relevance_score is from 0.0 to 100.0. Higher relevance means higher score."},
{"role": "system", "content": "You are an expert relevance ranker. Given a list of documents and a query, your job is to determine how relevant each document is for answering the query. Your output is JSON, which is a list of documents. Each document has two fields, content and relevance_score. relevance_score is from 0.0 to 100.0. Higher relevance means higher score."},
{"role": "user", "content": f"Query: {query} Docs: {docs}"}
]
)
Expand Down

0 comments on commit e559bf1

Please sign in to comment.