Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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}\
|
113 |
else:
|
114 |
-
combined_input = f"
|
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",
|