Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import requests as r
|
3 |
|
4 |
-
def askPrice():
|
5 |
res = r.request('https://orapiweb1.pttor.com/api/oilprice/LatestOilPrice')
|
6 |
return res.json()
|
7 |
|
@@ -10,4 +10,4 @@ def askPrice():
|
|
10 |
# with gr.Column(scale=1):
|
11 |
# with gr.Column(scale=1):
|
12 |
|
13 |
-
app = gr.Interface(fn=askPrice, outputs='json')
|
|
|
1 |
import gradio as gr
|
2 |
import requests as r
|
3 |
|
4 |
+
def askPrice(test):
|
5 |
res = r.request('https://orapiweb1.pttor.com/api/oilprice/LatestOilPrice')
|
6 |
return res.json()
|
7 |
|
|
|
10 |
# with gr.Column(scale=1):
|
11 |
# with gr.Column(scale=1):
|
12 |
|
13 |
+
app = gr.Interface(fn=askPrice,inputs='text' outputs='json')
|