aquibmoin commited on
Commit
64e5e97
1 Parent(s): 423c35e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -25,15 +25,21 @@ ADS.TOKEN = os.getenv('ADS_API_KEY') # Ensure your ADS API key is stored in env
25
  # Define system message with instructions
26
  system_message = """
27
  You are ExosAI, a helpful assistant specializing in Exoplanet research.
28
- Given the following scientific context and user input, generate a table with four columns:
29
- 1. Physical Processes: what physical processes are relevant.
30
- 2. Observables: what physical quantities to observe.
31
- 3. Technical Requirements: wavelength ranges, spatial resolution etc.
32
- 4. Relevant Scientific Goal: A scientific explanation of why these measurements are important.
 
 
33
 
34
- The table should include specific **technical requirements**, focussing on **optical and infrared wavelengths**, or any other relevant constraints based on the context, and avoid naming specific telescopes or instruments.
 
 
 
 
35
 
36
- The goal of the table is to summarize key scientific parameters, observables, technical needs, and goals related to the given context. Ensure the table is detailed and informative, and that it follows the format provided.
37
 
38
  """
39
 
@@ -115,9 +121,9 @@ def fetch_exoplanet_data():
115
 
116
  def generate_response(user_input, relevant_context="", references=[], max_tokens=150, temperature=0.7, top_p=0.9, frequency_penalty=0.5, presence_penalty=0.0):
117
  if relevant_context:
118
- combined_input = f"Scientific Context: {relevant_context}\nUser Input: {user_input}\nPlease generate a table with the format: | Physical Processes | Observables | Technical Requirements | Relevant Scientific Goal |"
119
  else:
120
- combined_input = f"User Input: {user_input}\nPlease generate a table with the format: | Physical Processes | Observables | Technical Requirements | Relevant Scientific Goal |"
121
 
122
  response = client.chat.completions.create(
123
  model="gpt-4-turbo",
 
25
  # Define system message with instructions
26
  system_message = """
27
  You are ExosAI, a helpful assistant specializing in Exoplanet research.
28
+ Given the following scientific context and user input, generate a table with five columns:
29
+ Technical Requirements Table: Generate a table with the following columns:
30
+ - Requirements: The specific observational requirements (e.g., UV observations, long wavelength observations).
31
+ - Necessary: The necessary values or parameters (e.g., wavelength ranges, spatial resolution).
32
+ - Desired: The desired values or parameters.
33
+ - Justification: A scientific explanation of why these requirements are important.
34
+ - Comments: Additional notes or remarks regarding each requirement.
35
 
36
+ Example:
37
+ | Requirements | Necessary | Desired | Justification | Comments |
38
+ |----------------------------------|------------------------------------------|------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
39
+ | UV Observations | Wavelength: 1200–2100 Å, 2500–3300 Å | Wavelength: 1200–3300 Å | Characterization of atomic and molecular emissions (H, C, O, S, etc.) from fluorescence and dissociative electron impact | Needed for detecting H2O, CO, CO2, and other volatile molecules relevant for volatile delivery studies. |
40
+ | Infrared Observations | Wavelength: 2.5–4.8 μm | Wavelength: 1.5–4.8 μm | Tracks water emissions and CO2 lines in icy bodies and small planetesimals | Also allows detection of 3 μm absorption feature in icy bodies. |
41
 
42
+ Ensure the response is structured clearly and the technical requirements table follows this format.
43
 
44
  """
45
 
 
121
 
122
  def generate_response(user_input, relevant_context="", references=[], max_tokens=150, temperature=0.7, top_p=0.9, frequency_penalty=0.5, presence_penalty=0.0):
123
  if relevant_context:
124
+ combined_input = f"Scientific Context: {relevant_context}\nUser Input: {user_input}\nPlease generate a table with the format: | Requirements | Necessary | Desired | Justification | Comments |"
125
  else:
126
+ combined_input = f"User Input: {user_input}\nPlease generate a table with the format: | Requirements | Necessary | Desired | Justification | Comments |"
127
 
128
  response = client.chat.completions.create(
129
  model="gpt-4-turbo",