aymnsk commited on
Commit
ef50bde
·
verified ·
1 Parent(s): e1be242

Create agents/base_agent.py

Browse files
Files changed (1) hide show
  1. 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)