Spaces:
Sleeping
Sleeping
Create bni_agent.py
Browse files- bni_agent.py +46 -0
bni_agent.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from phi.agent import Agent
|
| 3 |
+
from phi.model.openai import OpenAIChat
|
| 4 |
+
|
| 5 |
+
# Load environment variables (API keys, etc.)
|
| 6 |
+
from dotenv import load_dotenv
|
| 7 |
+
load_dotenv()
|
| 8 |
+
|
| 9 |
+
#####################################################################################
|
| 10 |
+
# BNI Membership Agent #
|
| 11 |
+
#####################################################################################
|
| 12 |
+
|
| 13 |
+
bni_agent = Agent(
|
| 14 |
+
name="BNI Membership Agent",
|
| 15 |
+
model=OpenAIChat(id="gpt-4o"),
|
| 16 |
+
description="Provides insights on how BNI membership can help a business grow.",
|
| 17 |
+
show_tool_calls=True,
|
| 18 |
+
markdown=True,
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
def get_bni_benefits(company_data: str) -> str:
|
| 22 |
+
"""
|
| 23 |
+
Generates a structured overview of how BNI membership can help the user's company.
|
| 24 |
+
|
| 25 |
+
Args:
|
| 26 |
+
company_data (str): User's company description, industry, and business details.
|
| 27 |
+
|
| 28 |
+
Returns:
|
| 29 |
+
str: Tailored insights on how BNI can benefit the company.
|
| 30 |
+
"""
|
| 31 |
+
query = f"""
|
| 32 |
+
Given the following company details:
|
| 33 |
+
- **Business Overview:** {company_data}
|
| 34 |
+
|
| 35 |
+
Provide a **structured explanation** of how **BNI membership** can **benefit this company**:
|
| 36 |
+
1. **Referral Generation** – How can BNI help this business generate quality referrals?
|
| 37 |
+
2. **Networking Opportunities** – How will industry-specific networking be useful?
|
| 38 |
+
3. **Professional Development** – What skills & business exposure can the company gain?
|
| 39 |
+
4. **Supportive Community** – How does BNI help businesses grow through peer support?
|
| 40 |
+
5. **Access to Resources** – What exclusive resources (mentorship, training, etc.) are beneficial?
|
| 41 |
+
6. **Revenue Growth Potential** – How can this business scale by leveraging BNI connections?
|
| 42 |
+
|
| 43 |
+
Make the response **personalized** to the company’s industry and nature of operations.
|
| 44 |
+
"""
|
| 45 |
+
response = bni_agent.run(query)
|
| 46 |
+
return response.content # Returns structured insights on BNI membership benefits
|