Spaces:
Build error
Build error
Commit
·
e6c5ede
1
Parent(s):
b2ed8a8
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ def agent_run(q, openai_api_key, mapi_api_key, serp_api_key):
|
|
| 17 |
try:
|
| 18 |
out = agent_chain.run(q)
|
| 19 |
except Exception as err:
|
| 20 |
-
out = f"Something went wrong
|
| 21 |
return out
|
| 22 |
|
| 23 |
with gr.Blocks(css=css_style) as demo:
|
|
@@ -26,16 +26,16 @@ with gr.Blocks(css=css_style) as demo:
|
|
| 26 |
- Developed by: Mayk Caldas ([@maykcaldas](https://github.com/maykcaldas)) and Sam Cox ([@SamCox822](https://github.com/SamCox822))
|
| 27 |
|
| 28 |
## What is this?
|
| 29 |
-
- This is a demo of
|
| 30 |
-
- Its
|
| 31 |
It is a work in progress, so please be patient with it.
|
| 32 |
|
| 33 |
|
| 34 |
-
### Some keys are needed
|
| 35 |
1. An openAI API key ( [Check it here](https://platform.openai.com/account/api-keys) )
|
| 36 |
-
2. A
|
| 37 |
3. A SERP API key ( [Check it here](https://serpapi.com/account-api) )
|
| 38 |
-
- Only used if the chain
|
| 39 |
''')
|
| 40 |
with gr.Accordion("List of properties we developed tools for", open=False):
|
| 41 |
gr.Markdown(f"""
|
|
@@ -61,7 +61,7 @@ with gr.Blocks(css=css_style) as demo:
|
|
| 61 |
mapi_api_key = gr.Textbox(
|
| 62 |
label="Material Project API Key", placeholder="...", type="password")
|
| 63 |
serp_api_key = gr.Textbox(
|
| 64 |
-
label="
|
| 65 |
with gr.Tab("MAPI Query"):
|
| 66 |
text_input = gr.Textbox(label="", placeholder="Enter question here...")
|
| 67 |
text_output = gr.Textbox(placeholder="Your answer will appear here...")
|
|
|
|
| 17 |
try:
|
| 18 |
out = agent_chain.run(q)
|
| 19 |
except Exception as err:
|
| 20 |
+
out = f"Something went wrong. Please try again.\nError: {err}"
|
| 21 |
return out
|
| 22 |
|
| 23 |
with gr.Blocks(css=css_style) as demo:
|
|
|
|
| 26 |
- Developed by: Mayk Caldas ([@maykcaldas](https://github.com/maykcaldas)) and Sam Cox ([@SamCox822](https://github.com/SamCox822))
|
| 27 |
|
| 28 |
## What is this?
|
| 29 |
+
- This is a demo of an app that can answer questions about material science using the [LangChain🦜️🔗](https://github.com/hwchase17/langchain/) and the [Materials Project API](https://materialsproject.org/).
|
| 30 |
+
- Its behavior is based on Large Language Models (LLM), and it aims to be a tool to help scientists with quick predictions of numerous properties of materials.
|
| 31 |
It is a work in progress, so please be patient with it.
|
| 32 |
|
| 33 |
|
| 34 |
+
### Some keys are needed to use it:
|
| 35 |
1. An openAI API key ( [Check it here](https://platform.openai.com/account/api-keys) )
|
| 36 |
+
2. A Material Project's API key ( [Check it here](https://materialsproject.org/api#api-key) )
|
| 37 |
3. A SERP API key ( [Check it here](https://serpapi.com/account-api) )
|
| 38 |
+
- Only used if the chain runs a web search to answer the question.
|
| 39 |
''')
|
| 40 |
with gr.Accordion("List of properties we developed tools for", open=False):
|
| 41 |
gr.Markdown(f"""
|
|
|
|
| 61 |
mapi_api_key = gr.Textbox(
|
| 62 |
label="Material Project API Key", placeholder="...", type="password")
|
| 63 |
serp_api_key = gr.Textbox(
|
| 64 |
+
label="Serp API Key", placeholder="...", type="password")
|
| 65 |
with gr.Tab("MAPI Query"):
|
| 66 |
text_input = gr.Textbox(label="", placeholder="Enter question here...")
|
| 67 |
text_output = gr.Textbox(placeholder="Your answer will appear here...")
|