aquibmoin commited on
Commit
5137e56
1 Parent(s): 87b29c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -64,21 +64,18 @@ def extract_keywords_with_gpt(user_input, max_tokens=100, temperature=0.3):
64
 
65
  return extracted_keywords
66
 
67
- def fetch_nasa_ads_references(user_input):
68
  try:
69
- # Step 1: Extract keywords using GPT (assuming you have this function)
70
- keywords = extract_keywords_with_gpt(user_input)
71
 
72
- # Step 2: Build a query using the extracted keywords
73
- simplified_query = keywords # Use keywords as the query
74
-
75
- # Step 3: Query NASA ADS for relevant papers
76
  papers = ADS.query_simple(simplified_query)
77
-
78
  if not papers or len(papers) == 0:
79
  return [("No results found", "N/A", "N/A")]
80
 
81
- # Step 4: Extract title, authors, and bibcode from the papers
82
  references = [
83
  (
84
  paper['title'][0],
 
64
 
65
  return extracted_keywords
66
 
67
+ def fetch_nasa_ads_references(prompt):
68
  try:
69
+ # Use the entire prompt for the query
70
+ simplified_query = prompt
71
 
72
+ # Query NASA ADS for relevant papers
 
 
 
73
  papers = ADS.query_simple(simplified_query)
74
+
75
  if not papers or len(papers) == 0:
76
  return [("No results found", "N/A", "N/A")]
77
 
78
+ # Include authors in the references
79
  references = [
80
  (
81
  paper['title'][0],