TANMIHA commited on
Commit
52b6a2f
·
verified ·
1 Parent(s): f72327a

Upload 4 files

Browse files
agents/__init__.py ADDED
File without changes
agents/classifier_agent.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from pathlib import Path
3
+ from autogen import AssistantAgent
4
+
5
+ from utility.prompt import classifier_prompt
6
+ from utility.llm_config import llm_config
7
+
8
+ from dotenv import load_dotenv
9
+ load_dotenv()
10
+
11
+ def get_classifier_agent():
12
+
13
+ agent_cls = AssistantAgent(
14
+ name="ClassifierAgent",
15
+ llm_config=llm_config,
16
+ system_message = classifier_prompt
17
+ )
18
+ return agent_cls
agents/knowledge_base_agent.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from autogen import AssistantAgent
2
+ from tools.knowledge_base_tool import search_similar_solution
3
+ from utility.llm_config import llm_config
4
+
5
+
6
+ def get_knowledge_base_agent():
7
+
8
+ knowledge_agent = AssistantAgent(
9
+ name="KnowledgeBaseAgent",
10
+ system_message=(
11
+ "You are an IT support assistant that retrieves solutions to user issues. "
12
+ "Always call the 'search_similar_solution' tool with the query to get a matching solution. "
13
+ "After calling, summarize the top solution and respond with TERMINATE."
14
+
15
+ ),
16
+ llm_config=llm_config, # Required for tool registration
17
+ code_execution_config={"use_docker": False},
18
+ )
19
+
20
+ # Register tool with LLM and executor
21
+ # 1. LLm knows when to call the tool
22
+ knowledge_agent.register_for_llm(
23
+ name="search_similar_solution",
24
+ description="Searches for top IT solutions from a knowledge base using a vector similarity search. Accepts query and top_k."
25
+ )(search_similar_solution)
26
+
27
+ # 2. Executed the tool
28
+ knowledge_agent.register_for_execution(
29
+ name="search_similar_solution"
30
+ )(search_similar_solution)
31
+
32
+ return knowledge_agent
33
+
34
+
35
+
36
+
agents/notification_agent.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from autogen import AssistantAgent
2
+ from utility.llm_config import llm_config
3
+
4
+
5
+ def get_notification_agent():
6
+ return AssistantAgent(
7
+ name="NotificationAgent",
8
+ system_message="You are an IT notification agent that sends alerts or escalates unresolved tickets.",
9
+ llm_config=llm_config
10
+ )