FloraJ commited on
Commit
ba91b26
·
1 Parent(s): 24b5b67
openai_function_utils/openai_function_impl.py CHANGED
@@ -59,12 +59,14 @@ def get_publication_by_year(year: str):
59
  with open(database_addr, 'r') as fin:
60
  all_pub_info = json.load(fin)
61
  data = {}
62
- for field in all_pub_info:
63
- print(f'field: {field}')
64
- to_search = all_pub_info[field]
65
- for i in to_search:
66
- if int(year) == i['year']:
67
- data.update(i)
 
 
68
  return json.dumps(data)
69
 
70
 
 
59
  with open(database_addr, 'r') as fin:
60
  all_pub_info = json.load(fin)
61
  data = {}
62
+ for pub in all_pub_info:
63
+ if int(year) == pub['year']:
64
+ data.update(pub)
65
+ # for field in all_pub_info:
66
+ # to_search = all_pub_info[field]
67
+ # for i in to_search:
68
+ # if int(year) == i['year']:
69
+ # data.update(i)
70
  return json.dumps(data)
71
 
72
 
static/index.html CHANGED
@@ -33,7 +33,7 @@
33
  <button class="question_btn">Give me a pub of J coleman</button>
34
  <button class="question_btn">What is the position of J coleman</button>
35
  <button class="question_btn">Give me a pub on neural network</button>
36
- <button class="question_btn">Give me a pub published in 2023 (deprecated)</button>
37
  <button class="question_btn">Give me a pub on math</button>
38
  </div>
39
  </body>
 
33
  <button class="question_btn">Give me a pub of J coleman</button>
34
  <button class="question_btn">What is the position of J coleman</button>
35
  <button class="question_btn">Give me a pub on neural network</button>
36
+ <button class="question_btn">Give me a pub published in 2023</button>
37
  <button class="question_btn">Give me a pub on math</button>
38
  </div>
39
  </body>