-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmain.py
More file actions
46 lines (36 loc) · 3.12 KB
/
main.py
File metadata and controls
46 lines (36 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# ██████╗ ███████╗ ██╗ ██╗ ███████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███████╗
# ██╔══██╗ ██╔════╝ ██║ ██║ ██╔════╝ ██╔══██╗ ██╔═══██╗ ██╔════╝ ██╔═══██╗ ██╔══██╗ ██╔════╝
# ██║ ██║ █████╗ ██║ ██║ ███████╗ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ █████╗
# ██║ ██║ ██╔══╝ ╚██╗ ██╔╝ ╚════██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██╔══╝
# ██████╔╝ ███████╗ ╚████╔╝ ███████║ ██████╔╝╚██████╔╝ ╚██████╗ ╚██████╔╝ ██████╔╝ ███████╗
# ╚═════╝ ╚══════╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
# Made With 💓 By - Sree ( Devs Do Code )
# YouTube Channel: https://www.youtube.com/@devsdocode
# For any questions or concerns, reach out to us via our social media handles.
# Our top choice for contact is Telegram: https://t.me/devsdocode
# You can also find us on other platforms listed above. We're here to help!
# - YouTube Channel: https://www.youtube.com/@DevsDoCode
# - Telegram Group: https://t.me/devsdocode
# - Discord Server: https://discord.gg/ehwfVtsAts
# - Instagram:
# - Personal: https://www.instagram.com/sree.shades_/
# - Channel: https://www.instagram.com/devsdocode_/
# ------------------------------------------------------------------------------
# Dive into the world of coding with Devs Do Code - where passion meets programming!
# Make sure to hit that Subscribe button to stay tuned for exciting content!
# Pro Tip: For optimal performance and a seamless experience, we recommend using
# the default library versions demonstrated in this demo. Your coding journey just
# got even better! Happy coding!
# ----------------------------------------------------------------------------
from Perplexity import Perplexity
perplexity_client = Perplexity()
query = "What is the capital of France? Write about the beauty of France"
answers = perplexity_client.generate_answer(query)
final_response = ""
for answer in answers:
try:
final_response = answer['answer']
# print(answer['answer'], end="\r", flush=True)
except Exception as e: continue
print(final_response)
print("\nDone.")