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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -25,10 +25,16 @@ 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
- Your goal is to provide detailed, structured answers by following these guidelines:
29
- - The central topic branches out into 3 science objectives.
30
- - Each science objective branches out into 2 physical parameters, and each physical parameter branches out into 2 observables.
31
- - Include details, provide scientific references, and make recommendations for observation parameters like wavelength, resolution, etc.
 
 
 
 
 
 
32
  """
33
 
34
  def encode_text(text):
@@ -109,9 +115,9 @@ def fetch_exoplanet_data():
109
 
110
  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):
111
  if relevant_context:
112
- combined_input = f"Context: {relevant_context}\nQuestion: {user_input}\nAnswer (please organize the answer in a structured format with topics and subtopics):"
113
  else:
114
- combined_input = f"Question: {user_input}\nAnswer (please organize the answer in a structured format with topics and subtopics):"
115
 
116
  response = client.chat.completions.create(
117
  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 four columns:
29
+ 1. Physical Parameters,
30
+ 2. Observables,
31
+ 3. Technical Requirements,
32
+ 4. Relevant Scientific Goal.
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
 
40
  def encode_text(text):
 
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 Parameters | Observables | Technical Requirements | Relevant Scientific Goal |"
119
  else:
120
+ combined_input = f"User Input: {user_input}\nPlease generate a table with the format: | Physical Parameters | Observables | Technical Requirements | Relevant Scientific Goal |"
121
 
122
  response = client.chat.completions.create(
123
  model="gpt-4-turbo",