Spaces:
Build error
Build error
Commit
·
597d095
1
Parent(s):
400c145
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ hugging_face_api_key = os.getenv("HUGGING_FACE_API_KEY")
|
|
| 18 |
openai_api_key = os.getenv("OPENAI_API_KEY")
|
| 19 |
|
| 20 |
# Set the API key for OpenAI
|
| 21 |
-
|
| 22 |
|
| 23 |
import requests
|
| 24 |
|
|
@@ -115,10 +115,14 @@ def talk_to_llm(user_prompt):
|
|
| 115 |
def complete_query(partial_query):
|
| 116 |
query_template = f'''
|
| 117 |
SELECT TOP 300000
|
|
|
|
| 118 |
-- IMPORTANT NOTE: Parameters that are in units of Magnitude must have an "as" name that ends in "_mag"
|
|
|
|
| 119 |
--Required parameters
|
|
|
|
| 120 |
-- ID - force a leading hash symbol to stop Excel from reading the ID number as a float
|
| 121 |
'#' || source_id as source_id,
|
|
|
|
| 122 |
-- Measured Position
|
| 123 |
ra,
|
| 124 |
dec,
|
|
@@ -127,21 +131,11 @@ def complete_query(partial_query):
|
|
| 127 |
pmra,
|
| 128 |
pmdec,
|
| 129 |
radial_velocity as rv,
|
|
|
|
| 130 |
--Key source light params for HR diagram
|
| 131 |
phot_g_mean_mag,
|
| 132 |
bp_rp as bp_rp_mag,
|
| 133 |
-
|
| 134 |
-
0 as l,
|
| 135 |
-
0 as b,
|
| 136 |
-
0 as X,
|
| 137 |
-
0 as Y,
|
| 138 |
-
0 as Z,
|
| 139 |
-
0 as U,
|
| 140 |
-
0 as V,
|
| 141 |
-
0 as W,
|
| 142 |
-
0 as abs_mag,
|
| 143 |
-
0 as zero,
|
| 144 |
-
1 as one,
|
| 145 |
--Optional plot parameters (you can add anything you want here, just give good unique "as" names - it will show up in the .cvs and hence in StarGate
|
| 146 |
phot_rp_mean_mag,
|
| 147 |
phot_bp_mean_mag,
|
|
@@ -156,7 +150,7 @@ def complete_query(partial_query):
|
|
| 156 |
FROM gaiadr3.gaia_source
|
| 157 |
{partial_query}
|
| 158 |
'''
|
| 159 |
-
|
| 160 |
print ("completed query")
|
| 161 |
print (query_template)
|
| 162 |
print (" ")
|
|
|
|
| 18 |
openai_api_key = os.getenv("OPENAI_API_KEY")
|
| 19 |
|
| 20 |
# Set the API key for OpenAI
|
| 21 |
+
# openai.api_key = openai_api_key
|
| 22 |
|
| 23 |
import requests
|
| 24 |
|
|
|
|
| 115 |
def complete_query(partial_query):
|
| 116 |
query_template = f'''
|
| 117 |
SELECT TOP 300000
|
| 118 |
+
|
| 119 |
-- IMPORTANT NOTE: Parameters that are in units of Magnitude must have an "as" name that ends in "_mag"
|
| 120 |
+
|
| 121 |
--Required parameters
|
| 122 |
+
|
| 123 |
-- ID - force a leading hash symbol to stop Excel from reading the ID number as a float
|
| 124 |
'#' || source_id as source_id,
|
| 125 |
+
|
| 126 |
-- Measured Position
|
| 127 |
ra,
|
| 128 |
dec,
|
|
|
|
| 131 |
pmra,
|
| 132 |
pmdec,
|
| 133 |
radial_velocity as rv,
|
| 134 |
+
|
| 135 |
--Key source light params for HR diagram
|
| 136 |
phot_g_mean_mag,
|
| 137 |
bp_rp as bp_rp_mag,
|
| 138 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
--Optional plot parameters (you can add anything you want here, just give good unique "as" names - it will show up in the .cvs and hence in StarGate
|
| 140 |
phot_rp_mean_mag,
|
| 141 |
phot_bp_mean_mag,
|
|
|
|
| 150 |
FROM gaiadr3.gaia_source
|
| 151 |
{partial_query}
|
| 152 |
'''
|
| 153 |
+
|
| 154 |
print ("completed query")
|
| 155 |
print (query_template)
|
| 156 |
print (" ")
|