-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.py
More file actions
68 lines (47 loc) · 2.18 KB
/
generate.py
File metadata and controls
68 lines (47 loc) · 2.18 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import cohere
import streamlit as st
# get api key from .env
from dotenv import load_dotenv
import os
load_dotenv()
# get api key from .env
cohere_api_key = st.secrets["COHERE_API_KEY"]
co= cohere.ClientV2(cohere_api_key)
def generate_idea(industry, temperature=0.7):
prompt = f"""
Generate a startup idea given the industry. Return the startup idea and without additional commentary.
Industry: Workplace
Startup Idea: A platform that generates slide deck contents automatically based on a given outline
Industry: Home Decor
Startup Idea: An app that calculates the best position of your indoor plants for your apartment
Industry: Healthcare
Startup Idea: A hearing aid for the elderly that automatically adjusts its levels and with a battery lasting a whole week
Industry: Education
Startup Idea: An online primary school that lets students mix and match their own curriculum based on their interests and goals
Industry: {industry}
Startup Idea:"""
# Call the Cohere Chat endpoint
response = co.chat(
messages=[{"role": "user", "content": prompt}],
model="command-r-plus-08-2024",
temperature=temperature)
return response.message.content[0].text
def generate_name(idea, temperature=0.7):
prompt= f"""
Generate a startup name given the startup idea. Return the startup name and without additional commentary.
Startup Idea: A platform that generates slide deck contents automatically based on a given outline
Startup Name: Deckerize
Startup Idea: An app that calculates the best position of your indoor plants for your apartment
Startup Name: Planteasy
Startup Idea: A hearing aid for the elderly that automatically adjusts its levels and with a battery lasting a whole week
Startup Name: Hearspan
Startup Idea: An online primary school that lets students mix and match their own curriculum based on their interests and goals
Startup Name: Prime Age
Startup Idea: {idea}
Startup Name:"""
# Call the Cohere Chat endpoint
response = co.chat(
messages=[{"role": "user", "content": prompt}],
model="command-r-plus-08-2024",
temperature=temperature)
return response.message.content[0].text