Aniun commited on
Commit
838f2c8
·
verified ·
1 Parent(s): d324047

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -12,13 +12,12 @@ root_path = os.path.abspath(current_file_path)
12
 
13
  from datetime import datetime, time
14
  from textwrap import dedent
15
-
16
  from langchain_openai import ChatOpenAI
17
  from langchain_core.prompts import ChatPromptTemplate
18
 
19
  import re
20
 
21
-
22
  # 获取当前文件位置
23
  current_path = os.path.dirname(os.path.abspath(__file__))
24
 
@@ -289,13 +288,11 @@ def main():
289
 
290
  query = llm.ask_question(prompt, system_prompt=llm.get_system_prompt("keyword_expand")).content
291
  json_obj = ", ".join(json.loads(query)["keywords"])
292
- # response["content"] = "拓展后关键词:" + json_obj
293
- # yield history + [response]
294
 
295
  response["content"] = "开始通过 LLM 评分得到最匹配的仓库..."
296
  yield history + [response]
297
- simple_str, simple_list = search.search(query, 40)
298
- query = json_obj + '\n' + simple_str
299
  out = llm.ask_question(query, system_prompt=llm.get_system_prompt("github_score")).content
300
 
301
  out = out.replace('```json','').replace('```','').strip()
 
12
 
13
  from datetime import datetime, time
14
  from textwrap import dedent
15
+
16
  from langchain_openai import ChatOpenAI
17
  from langchain_core.prompts import ChatPromptTemplate
18
 
19
  import re
20
 
 
21
  # 获取当前文件位置
22
  current_path = os.path.dirname(os.path.abspath(__file__))
23
 
 
288
 
289
  query = llm.ask_question(prompt, system_prompt=llm.get_system_prompt("keyword_expand")).content
290
  json_obj = ", ".join(json.loads(query)["keywords"])
 
 
291
 
292
  response["content"] = "开始通过 LLM 评分得到最匹配的仓库..."
293
  yield history + [response]
294
+ simple_str, simple_list = search.search(json_obj, 40)
295
+ query = '用户需要的仓库内容:' + prompt + '\n 搜索结果列表:' + simple_str
296
  out = llm.ask_question(query, system_prompt=llm.get_system_prompt("github_score")).content
297
 
298
  out = out.replace('```json','').replace('```','').strip()