Spaces:
Running
on
Zero
Running
on
Zero
File size: 5,270 Bytes
14dc68f |
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
from skills.skill import Skill
import openai
import json
class StartupAnalysis(Skill):
name = 'startup_analysis'
description = "A tool specialized in providing a detailed analysis of startups using OpenAI's text completion API. Analyzes parameters like customers, ICP, pain points, competitors, etc."
api_keys_required = ['openai']
def __init__(self, api_keys, main_loop_function):
super().__init__(api_keys, main_loop_function)
def execute(self, params, dependent_task_outputs, objective):
if not self.valid:
return
completion = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{
"role": "system",
"content": "You are a great AI analyst specialized in writing VC investment memos. Write one paragraph each in the third person on customers, ICP, pain points, alternate solutions, competitors, potential partners, key incumbents, history of innovation in the industry, key risks, legal considerations, important figures or influencers, and other recent trends in the space. The user will provide the startup description."
},
{
"role": "user",
"content": params
# User provides a detailed description of their startup
}
],
functions=[
{
"name": "analyze_startup",
"description": "Analyze the startup based on various parameters",
"parameters": {
"type": "object",
"properties": {
"customers": {
"type": "string",
"description": "Who are the startup's primary customers. Describe in detail in the third person."
},
"ICP": {
"type": "string",
"description": "What is the startup's Ideal Customer Profile. Describe in detail in the third person."
},
"pain_points": {
"type": "string",
"description": "What are the pain points the startup is trying to solve. Describe in detail in the third person."
},
"alternate_solutions": {
"type": "string",
"description": "What are the alternate solutions available in the market. Describe in detail in the third person."
},
"competitors": {
"type": "string",
"description": "Who are the startup's main competitors. Describe in detail in the third person."
},
"potential_partners": {
"type": "string",
"description": "Who could be the startup's potential partners. Describe in detail in the third person."
},
"key_incumbents": {
"type": "string",
"description": "Key incumbents in the industry. Describe in detail."
},
"history_of_innovation": {
"type": "string",
"description": "History of innovation in the startup's industry. Describe in detail in the third person."
},
"key_risks": {
"type": "string",
"description": "What are the key risks involved in the startup. Describe in detail in the third person."
},
"legal_considerations": {
"type": "string",
"description": "Any legal considerations that the startup should be aware of"
},
"important_figures": {
"type": "string",
"description": "Important figures or influencers in the industry. Describe in detail in the third person."
},
"recent_trends": {
"type": "string",
"description": "What are the recent trends in the startup's industry. Describe in detail."
}
},
"required": [
"customers", "ICP", "pain_points", "alternate_solutions",
"competitors", "potential_partners", "key_incumbents",
"history_of_innovation", "key_risks", "legal_considerations",
"important_figures", "recent_trends"
],
},
},
],
function_call={"name": "analyze_startup"}
)
response_data = completion.choices[0]['message']['function_call']['arguments']
html_content = ""
for key, value in json.loads(response_data).items():
html_content += f"<strong>{key.capitalize()}</strong>: {value}</br>\n"
return html_content
|