Skip to content

Commit

Permalink
feat: add db engine to agent
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien committed Nov 13, 2024
1 parent 191dc43 commit c61da50
Showing 1 changed file with 42 additions and 43 deletions.
85 changes: 42 additions & 43 deletions app/agents/base_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,49 +55,8 @@ def transfer_to_apologize():
]
)

help_center_agent = Agent(
name="Help Center Agent",
instructions="You are a Teslamate and Myteslamate agent who deals with questions about these products.",
functions=[query_docs, submit_ticket, send_email, transfer_to_user_center_agent]
)

stripe_agent = Agent(
name="Stripe Agent",
instructions="""
You are a Stripe help center agent who deals with questions about customers, subscription status, payment, billing etc.
Important for stripe_cancel and stripe_refund: Always ask to confirm and display id used before run!
No need to confirm to stripe_payments_list and stripe_query.
Always ask if you need to pass the task to user center agent or stripe agent.
""",
functions=[stripe_query, stripe_payments_list, stripe_cancel, stripe_refund, transfer_to_user_center_agent],
)

grafana_agent = Agent(
name="Grafana Agent",
instructions="""You are a Grafana help center agent who deals with questions about users, dashboards etc.
Always ask if you need to pass the task to user center agent or stripe agent.
""",
functions=[grafana_query, transfer_to_user_center_agent],
)

kubectl_agent = Agent(
name="Kubectl Agent",
instructions="""You are a kubectl reading bot that can answer users' questions using information from a kubernetes. \n
In the previous step, a plan has been prepared. Use the plan to create a kubectl command and call the command.
The command ALWAYS begin by "kubectl ".
Please send is_sync parameter as boolean only for update_sync_policy.
Please always confirm before run restore_db and update_grafana.
""",
functions=[kubectl, get_app, update_sync_policy, restore_db, update_grafana, transfer_to_user_center_agent]
)


DATA_DESCRIPTION = """
The database contains an app dataset split into two tables:
The Postgre database contains an app dataset split into two tables:
1. Table: users:
This table contains details about users, including their id, name, email, grafana_org_id.
Expand All @@ -106,7 +65,7 @@ def transfer_to_apologize():
2. Table: services:
This table provides services owned by users including id, user_id and status.
Columns: id, name, created_at, user_id, status.
"""

db_agent = Agent(
Expand Down Expand Up @@ -146,3 +105,43 @@ def transfer_to_apologize():
instructions="Apologize and explain to the user why you cannot complete the task and retrieve the data.",
functions=[transfer_to_query]
)

help_center_agent = Agent(
name="Help Center Agent",
instructions="You are a Teslamate and Myteslamate agent who deals with questions about these products.",
functions=[query_docs, submit_ticket, send_email, transfer_to_user_center_agent]
)

stripe_agent = Agent(
name="Stripe Agent",
instructions="""
You are a Stripe help center agent who deals with questions about customers, subscription status, payment, billing etc.
Important for stripe_cancel and stripe_refund: Always ask to confirm and display id used before run!
No need to confirm to stripe_payments_list and stripe_query.
Always ask if you need to pass the task to user center agent or stripe agent.
""",
functions=[stripe_query, stripe_payments_list, stripe_cancel, stripe_refund, transfer_to_user_center_agent],
)

grafana_agent = Agent(
name="Grafana Agent",
instructions="""You are a Grafana help center agent who deals with questions about users, dashboards etc.
Always ask if you need to pass the task to user center agent or stripe agent.
""",
functions=[grafana_query, transfer_to_user_center_agent],
)

kubectl_agent = Agent(
name="Kubectl Agent",
instructions="""You are a kubectl reading bot that can answer users' questions using information from a kubernetes. \n
In the previous step, a plan has been prepared. Use the plan to create a kubectl command and call the command.
The command ALWAYS begin by "kubectl ".
Please send is_sync parameter as boolean only for update_sync_policy.
Please always confirm before run restore_db and update_grafana.
""",
functions=[kubectl, get_app, update_sync_policy, restore_db, update_grafana, transfer_to_user_center_agent]
)

0 comments on commit c61da50

Please sign in to comment.