Spaces:
Running
Running
Commit
·
ebeb6e9
1
Parent(s):
62a2499
..
Browse files- __pycache__/create.cpython-312.pyc +0 -0
- app.py +2 -56
- create.py +55 -0
__pycache__/create.cpython-312.pyc
ADDED
|
Binary file (3.86 kB). View file
|
|
|
app.py
CHANGED
|
@@ -1,62 +1,8 @@
|
|
| 1 |
from openai import OpenAI
|
| 2 |
-
|
| 3 |
import gradio as gr # oh yeah!
|
| 4 |
|
| 5 |
|
| 6 |
-
|
| 7 |
-
def set_openai_api_key(apikey):
|
| 8 |
-
return apikey, "✅ API key has been set and stored!"
|
| 9 |
-
|
| 10 |
-
system_message = "You are a helpful assistant"
|
| 11 |
-
|
| 12 |
-
def create_gtm(api_key, product,location):
|
| 13 |
-
openai = OpenAI(api_key=api_key)
|
| 14 |
-
messages = [
|
| 15 |
-
{"role": "system", "content": system_message},
|
| 16 |
-
{"role": "user", "content": f"Act like a world class market research specialist. I want to promote {product} at {location}. Share a list of segments, potential geographies, decision-makers should target building a GTM strategy. Please give me the output in tabular format. Sort the segments in the decreasing order of the market size & demand"}
|
| 17 |
-
]
|
| 18 |
-
completion = openai.chat.completions.create(
|
| 19 |
-
model='gpt-4o-mini',
|
| 20 |
-
messages=messages,
|
| 21 |
-
)
|
| 22 |
-
return completion.choices[0].message.content
|
| 23 |
-
|
| 24 |
-
def buyers_persona(api_key, product,location,segment):
|
| 25 |
-
openai = OpenAI(api_key=api_key)
|
| 26 |
-
messages = [
|
| 27 |
-
{"role": "system", "content": system_message},
|
| 28 |
-
{"role": "user", "content": f"Act like a World Class market Research Specilaist and do the task. I am selling {product} to {segment} at {location}. Build a Buyers Persona in tabular format classify the information based on Demography, Geo, Psychography, Behavior, also add buying barriers and buying triggers, Keywords they browse, Things they want to change, Their fear, etc."}
|
| 29 |
-
]
|
| 30 |
-
completion = openai.chat.completions.create(
|
| 31 |
-
model='gpt-4o-mini',
|
| 32 |
-
messages=messages,
|
| 33 |
-
)
|
| 34 |
-
return completion.choices[0].message.content
|
| 35 |
-
|
| 36 |
-
def create_uvp(api_key, product,location,segment,goal,problem,solution):
|
| 37 |
-
openai = OpenAI(api_key=api_key)
|
| 38 |
-
messages = [
|
| 39 |
-
{"role": "system", "content": system_message},
|
| 40 |
-
{"role": "user", "content": f"I am selling {product} to {segment} in {location} I want you to act as a Marketing expert specializing in creating unique value propositions for {product} targeted to {segment} Craft a compelling and concise unique value proposition statement under 200 characters that highlights how to achieve {goal} without {problem} by utilizing {solution}."}
|
| 41 |
-
]
|
| 42 |
-
completion = openai.chat.completions.create(
|
| 43 |
-
model='gpt-4o-mini',
|
| 44 |
-
messages=messages,
|
| 45 |
-
)
|
| 46 |
-
return completion.choices[0].message.content
|
| 47 |
-
|
| 48 |
-
def create_usp(api_key, product,location,segment):
|
| 49 |
-
openai = OpenAI(api_key=api_key)
|
| 50 |
-
messages = [
|
| 51 |
-
{"role": "system", "content": system_message},
|
| 52 |
-
{"role": "user", "content": f"My product is {product} selling to {segment} at {location} Please give the list of USPs & Group the USPs under 7Ps of Marketing."}
|
| 53 |
-
]
|
| 54 |
-
completion = openai.chat.completions.create(
|
| 55 |
-
model='gpt-4o-mini',
|
| 56 |
-
messages=messages,
|
| 57 |
-
)
|
| 58 |
-
return completion.choices[0].message.content
|
| 59 |
-
|
| 60 |
with gr.Blocks(theme="Ocean", title="Complete GTM Strategy") as ui:
|
| 61 |
|
| 62 |
api_key_state = gr.State()
|
|
@@ -90,7 +36,7 @@ with gr.Blocks(theme="Ocean", title="Complete GTM Strategy") as ui:
|
|
| 90 |
button2=gr.Button("Create Buyers Persona")
|
| 91 |
with gr.Column():
|
| 92 |
output_text2=gr.Markdown(height=400, max_height=400, show_copy_button=True)
|
| 93 |
-
button2.click(fn=
|
| 94 |
|
| 95 |
with gr.Row():
|
| 96 |
with gr.Column():
|
|
|
|
| 1 |
from openai import OpenAI
|
| 2 |
+
from create import create_gtm,create_usp,create_uvp,create_buyers_persona,set_openai_api_key
|
| 3 |
import gradio as gr # oh yeah!
|
| 4 |
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
with gr.Blocks(theme="Ocean", title="Complete GTM Strategy") as ui:
|
| 7 |
|
| 8 |
api_key_state = gr.State()
|
|
|
|
| 36 |
button2=gr.Button("Create Buyers Persona")
|
| 37 |
with gr.Column():
|
| 38 |
output_text2=gr.Markdown(height=400, max_height=400, show_copy_button=True)
|
| 39 |
+
button2.click(fn=create_buyers_persona, scroll_to_output=True ,inputs=[api_key_state,product,location,segment], outputs=output_text2)
|
| 40 |
|
| 41 |
with gr.Row():
|
| 42 |
with gr.Column():
|
create.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from openai import OpenAI
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def set_openai_api_key(apikey):
|
| 5 |
+
return apikey, "✅ API key has been set and stored!"
|
| 6 |
+
|
| 7 |
+
system_message = "You are a helpful assistant"
|
| 8 |
+
|
| 9 |
+
def create_gtm(api_key, product,location):
|
| 10 |
+
openai = OpenAI(api_key=api_key)
|
| 11 |
+
messages = [
|
| 12 |
+
{"role": "system", "content": system_message},
|
| 13 |
+
{"role": "user", "content": f"Act like a world class market research specialist. I want to promote {product} at {location}. Share a list of segments, potential geographies, decision-makers should target building a GTM strategy. Please give me the output in tabular format. Sort the segments in the decreasing order of the market size & demand"}
|
| 14 |
+
]
|
| 15 |
+
completion = openai.chat.completions.create(
|
| 16 |
+
model='gpt-4o-mini',
|
| 17 |
+
messages=messages,
|
| 18 |
+
)
|
| 19 |
+
return completion.choices[0].message.content
|
| 20 |
+
|
| 21 |
+
def create_buyers_persona(api_key, product,location,segment):
|
| 22 |
+
openai = OpenAI(api_key=api_key)
|
| 23 |
+
messages = [
|
| 24 |
+
{"role": "system", "content": system_message},
|
| 25 |
+
{"role": "user", "content": f"Act like a World Class market Research Specilaist and do the task. I am selling {product} to {segment} at {location}. Build a Buyers Persona in tabular format classify the information based on Demography, Geo, Psychography, Behavior, also add buying barriers and buying triggers, Keywords they browse, Things they want to change, Their fear, etc."}
|
| 26 |
+
]
|
| 27 |
+
completion = openai.chat.completions.create(
|
| 28 |
+
model='gpt-4o-mini',
|
| 29 |
+
messages=messages,
|
| 30 |
+
)
|
| 31 |
+
return completion.choices[0].message.content
|
| 32 |
+
|
| 33 |
+
def create_uvp(api_key, product,location,segment,goal,problem,solution):
|
| 34 |
+
openai = OpenAI(api_key=api_key)
|
| 35 |
+
messages = [
|
| 36 |
+
{"role": "system", "content": system_message},
|
| 37 |
+
{"role": "user", "content": f"I am selling {product} to {segment} in {location} I want you to act as a Marketing expert specializing in creating unique value propositions for {product} targeted to {segment} Craft a compelling and concise unique value proposition statement under 200 characters that highlights how to achieve {goal} without {problem} by utilizing {solution}."}
|
| 38 |
+
]
|
| 39 |
+
completion = openai.chat.completions.create(
|
| 40 |
+
model='gpt-4o-mini',
|
| 41 |
+
messages=messages,
|
| 42 |
+
)
|
| 43 |
+
return completion.choices[0].message.content
|
| 44 |
+
|
| 45 |
+
def create_usp(api_key, product,location,segment):
|
| 46 |
+
openai = OpenAI(api_key=api_key)
|
| 47 |
+
messages = [
|
| 48 |
+
{"role": "system", "content": system_message},
|
| 49 |
+
{"role": "user", "content": f"My product is {product} selling to {segment} at {location} Please give the list of USPs & Group the USPs under 7Ps of Marketing."}
|
| 50 |
+
]
|
| 51 |
+
completion = openai.chat.completions.create(
|
| 52 |
+
model='gpt-4o-mini',
|
| 53 |
+
messages=messages,
|
| 54 |
+
)
|
| 55 |
+
return completion.choices[0].message.content
|