2
2
import sys
3
3
import logging
4
4
from pydantic import BaseModel , Field
5
- from utils . api_wrapper import get_structured_output
5
+ from dotenv import load_dotenv
6
6
7
7
# Add the project root directory to the Python path
8
- project_root = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' ))
8
+ project_root = os .path .abspath (os .path .join (os .path .dirname (__file__ )))
9
9
sys .path .insert (0 , project_root )
10
10
11
11
from agents .base_agent import BaseAgent
@@ -15,15 +15,20 @@ class BaselineAnalysis(BaseModel):
15
15
score : float = Field (..., description = "Overall score between 1 and 10" )
16
16
recommendation : str = Field (..., description = "Recommendation: 'Successful' or 'Unsuccessful'" )
17
17
18
+ # Load environment variables
19
+ load_dotenv ()
20
+
18
21
class BaselineFramework (BaseAgent ):
19
22
def __init__ (self , model = "gpt-4o-mini" ):
20
23
super ().__init__ (model )
21
24
self .logger = logging .getLogger (__name__ )
22
25
23
- def analyze_startup (self , startup_info_str : str ) -> dict :
26
+ def analyze_startup (self , startup_info : str ) -> dict :
24
27
"""Simple baseline analysis using only ChatGPT"""
25
28
self .logger .info ("Starting baseline analysis" )
26
29
30
+ # Format startup info similar to other agents
31
+
27
32
prompt = """
28
33
You are an experienced venture capitalist analyzing a startup. Based on the provided information,
29
34
give a comprehensive analysis and predict if the startup will be successful or not.
@@ -37,41 +42,30 @@ def analyze_startup(self, startup_info_str: str) -> dict:
37
42
"""
38
43
39
44
try :
40
- response = self .get_structured_output (BaselineAnalysis , prompt , startup_info_str )
45
+ response = self .get_json_response (BaselineAnalysis , prompt , "Startup Info: " + startup_info )
41
46
return response .dict ()
42
47
43
48
except Exception as e :
44
49
self .logger .error (f"Error in baseline analysis: { str (e )} " )
45
50
return {"error" : str (e )}
46
-
51
+
47
52
if __name__ == "__main__" :
48
53
def test_baseline_framework ():
49
54
# Create a BaselineFramework instance
50
55
framework = BaselineFramework ()
51
56
52
- # Test startup info
53
- test_startup = """
54
- Company Name: TechStart
55
- Description: AI-powered software development platform
56
- Product Details: Cloud-based IDE with AI assistance for code generation and debugging
57
- Technology Stack: Python, React, AWS
58
- Founder Background: Ex-Google engineer with 10 years experience in developer tools
59
- """
57
+ # Test startup info following the pattern from FounderAgent test
58
+ startup_info = "We are a startup that provides a platform for AI-powered software development. Our founders are from Oxford university."
60
59
61
60
try :
62
- # Test analyze_startup method
63
61
print ("Testing BaselineFramework analyze_startup:" )
64
62
print ("-" * 50 )
65
- result = framework .analyze_startup (test_startup )
63
+ result = framework .analyze_startup (startup_info )
66
64
67
- # Print results in a formatted way
65
+ print ( " \n Analysis Results:" )
68
66
for key , value in result .items ():
69
67
print (f"\n { key } :" )
70
- if isinstance (value , dict ):
71
- for k , v in value .items ():
72
- print (f" { k } : { v } " )
73
- else :
74
- print (f" { value } " )
68
+ print (f" { value } " )
75
69
76
70
print ("\n Test completed successfully!" )
77
71
0 commit comments