Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,12 +16,6 @@ See the end of this notebook for examples of real-world business applications.
|
|
| 16 |
And remember: I'm always available if you have problems or ideas! Please do reach out.
|
| 17 |
"""
|
| 18 |
|
| 19 |
-
# !pip install dotenv
|
| 20 |
-
# !pip install openai
|
| 21 |
-
# !pip install bs4
|
| 22 |
-
# !pip install requests
|
| 23 |
-
# !pip install python-dotenv
|
| 24 |
-
# !pip install IPython
|
| 25 |
|
| 26 |
# import the important
|
| 27 |
|
|
@@ -34,12 +28,6 @@ from bs4 import BeautifulSoup
|
|
| 34 |
from IPython.display import Markdown, display, update_display
|
| 35 |
from openai import OpenAI
|
| 36 |
|
| 37 |
-
# #initilize the openai key
|
| 38 |
-
# from google.colab import userdata
|
| 39 |
-
# open_ai_key = userdata.get('OPENAI_API_KEY')
|
| 40 |
-
# grok_key = userdata.get('XAI_API_KEY')
|
| 41 |
-
# openai = OpenAI(api_key = open_ai_key)
|
| 42 |
-
# MODEL = 'gpt-4o-mini'
|
| 43 |
|
| 44 |
# Initialize and constants
|
| 45 |
|
|
@@ -135,7 +123,7 @@ link_system_prompt += """
|
|
| 135 |
}
|
| 136 |
"""
|
| 137 |
|
| 138 |
-
|
| 139 |
|
| 140 |
def get_links_user_prompt(website):
|
| 141 |
user_prompt = f"Here is the list of links on the website of {website.url} - "
|
|
@@ -217,7 +205,7 @@ def get_pitch_user_prompt(company_name, url):
|
|
| 217 |
user_prompt = user_prompt[:5_000] # Truncate if more than 5,000 characters
|
| 218 |
return user_prompt
|
| 219 |
|
| 220 |
-
|
| 221 |
|
| 222 |
def pitch_deck(company_name, url):
|
| 223 |
response = openai.chat.completions.create(
|
|
@@ -255,11 +243,9 @@ def stream_pitchdeck(company_name, url):
|
|
| 255 |
response = response.replace("```","").replace("markdown", "")
|
| 256 |
update_display(Markdown(response), display_id=display_handle.display_id)
|
| 257 |
|
| 258 |
-
stream_pitchdeck("Squeaky Cleaning Services", "https://squeakycleaningservices.co.uk")
|
| 259 |
|
| 260 |
-
#
|
| 261 |
|
| 262 |
-
# stream_pitchdeck("Squeaky Cleaning Services", "https://squeakycleaningservices.co.uk")
|
| 263 |
|
| 264 |
import gradio as gr
|
| 265 |
|
|
|
|
| 16 |
And remember: I'm always available if you have problems or ideas! Please do reach out.
|
| 17 |
"""
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
# import the important
|
| 21 |
|
|
|
|
| 28 |
from IPython.display import Markdown, display, update_display
|
| 29 |
from openai import OpenAI
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# Initialize and constants
|
| 33 |
|
|
|
|
| 123 |
}
|
| 124 |
"""
|
| 125 |
|
| 126 |
+
|
| 127 |
|
| 128 |
def get_links_user_prompt(website):
|
| 129 |
user_prompt = f"Here is the list of links on the website of {website.url} - "
|
|
|
|
| 205 |
user_prompt = user_prompt[:5_000] # Truncate if more than 5,000 characters
|
| 206 |
return user_prompt
|
| 207 |
|
| 208 |
+
|
| 209 |
|
| 210 |
def pitch_deck(company_name, url):
|
| 211 |
response = openai.chat.completions.create(
|
|
|
|
| 243 |
response = response.replace("```","").replace("markdown", "")
|
| 244 |
update_display(Markdown(response), display_id=display_handle.display_id)
|
| 245 |
|
|
|
|
| 246 |
|
| 247 |
+
#gradio
|
| 248 |
|
|
|
|
| 249 |
|
| 250 |
import gradio as gr
|
| 251 |
|