Create agents/base_agent.py
Browse files- agents/base_agent.py +11 -0
agents/base_agent.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# agents/base_agent.py
|
2 |
+
|
3 |
+
class BaseAgent:
|
4 |
+
def __init__(self, name, role_description):
|
5 |
+
self.name = name
|
6 |
+
self.role = role_description
|
7 |
+
|
8 |
+
def generate_response(self, prompt, inference_fn):
|
9 |
+
system_prompt = f"You are {self.name}, a {self.role}. Respond uniquely and in your voice."
|
10 |
+
full_prompt = f"{system_prompt}\nUser: {prompt}\n{self.name}:"
|
11 |
+
return inference_fn(full_prompt)
|