Spaces:
Running
Running
Update app.py
Browse files
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
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
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: |
|
119 |
else:
|
120 |
-
combined_input = f"User Input: {user_input}\nPlease generate a table with the format: |
|
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",
|