Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
import os
|
2 |
import json
|
3 |
import asyncio
|
|
|
|
|
4 |
|
5 |
-
from websearch import
|
6 |
|
7 |
# load .env file
|
8 |
from dotenv import load_dotenv
|
@@ -13,12 +15,6 @@ perplexity_client = PerplexityClient(
|
|
13 |
api_key=os.environ["PERPLEXITY_AUTH_TOKEN"]
|
14 |
)
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
import gradio as gr
|
19 |
-
import httpx
|
20 |
-
import json
|
21 |
-
|
22 |
async def query_api(query: str) -> tuple:
|
23 |
try:
|
24 |
# Fetch response from Perplexity
|
|
|
1 |
import os
|
2 |
import json
|
3 |
import asyncio
|
4 |
+
import gradio as gr
|
5 |
+
import httpx
|
6 |
|
7 |
+
from websearch import PerplexityClient, parse_perplexity_response
|
8 |
|
9 |
# load .env file
|
10 |
from dotenv import load_dotenv
|
|
|
15 |
api_key=os.environ["PERPLEXITY_AUTH_TOKEN"]
|
16 |
)
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
async def query_api(query: str) -> tuple:
|
19 |
try:
|
20 |
# Fetch response from Perplexity
|