-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpm_research_ollama.py
117 lines (108 loc) · 3.87 KB
/
pm_research_ollama.py
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
107
108
109
110
111
112
113
114
115
116
117
from phi.agent import Agent
from phi.model.ollama import Ollama
from phi.tools.googlesearch import GoogleSearch
from phi.tools.yfinance import YFinanceTools
import inspect
import types
# Define individual agents with Ollama - removing tools from the model configuration
web_agent = Agent(
name="Web Agent",
role="Search the web for information",
model=Ollama(id="llama2:13b"),
tools=[GoogleSearch()],
instructions=["Always include sources"],
show_tool_calls=True,
markdown=True,
)
finance_agent = Agent(
name="Finance Agent",
role="Get financial data",
model=Ollama(id="llama2:13b"),
tools=[YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True)],
instructions=["Use tables to display data"],
show_tool_calls=True,
markdown=True,
)
tech_market_agent = Agent(
name="Technology and Market Opportunity Expert",
role="Analyze technology trends, market dynamics, and identify value creation opportunities",
model=Ollama(id="llama2:13b"),
tools=[GoogleSearch()],
instructions=[
"Analyze emerging technology trends and market dynamics",
"Identify potential market opportunities",
"Evaluate competitive landscapes",
"Always include data-driven insights",
"Always include sources"
],
show_tool_calls=True,
markdown=True,
)
value_capture_agent = Agent(
name="Value Capture Strategist",
role="Develop strategies for IP protection, market positioning, and competitive advantage",
model=Ollama(id="llama2:13b"),
tools=[GoogleSearch()],
instructions=[
"Focus on IP protection strategies",
"Develop market positioning recommendations",
"Identify competitive advantages",
"Provide actionable strategic recommendations",
"Always include sources"
],
show_tool_calls=True,
markdown=True,
)
org_design_agent = Agent(
name="Organizational Design Architect",
role="Design optimal organizational structures and collaboration networks",
model=Ollama(id="llama2:13b"),
tools=[GoogleSearch()],
instructions=[
"Design team structures and collaboration frameworks",
"Optimize for innovation and value delivery",
"Consider organizational culture and dynamics",
"Provide practical implementation steps",
"Always include sources"
],
show_tool_calls=True,
markdown=True,
)
# Combine agents into a team
agent_team = Agent(
team=[
web_agent,
finance_agent,
tech_market_agent,
value_capture_agent,
org_design_agent
],
instructions=[
"Always include sources",
"Use tables to display data",
"Provide comprehensive product management strategies",
"Integrate market, technology, and organizational perspectives",
"Focus on both value creation and value capture",
"Include actionable recommendations"
],
show_tool_calls=True,
markdown=True,
)
def inspect_function(func):
if callable(func):
if isinstance(func, types.BuiltinFunctionType):
print("Cannot inspect signature of built-in type.")
else:
try:
argspec = inspect.signature(func)
print(f"Signature: {argspec}")
except ValueError:
print("Signature could not be retrieved.")
else:
raise ValueError("Provided object is not callable.")
def start_business_analysis():
business_type = input("What kind of company do you want to create? ")
prompt = f"Analyze the opportunities, challenges, and strategies for creating a company focused on '{business_type}'. Provide comprehensive recommendations on market positioning, financial planning, technology trends, organizational design, and value capture."
agent_team.print_response(prompt, stream=True)
if __name__ == "__main__":
start_business_analysis()