Skip to content

Commit 45dceba

Browse files
committed
Remove unused agent and request models
Deleted several agent-related models and request/response classes from messages_kernel.py that are no longer used. Also removed the AgentType enum from orchestration_models.py to clean up unused code and improve maintainability.
1 parent f9a3ba0 commit 45dceba

File tree

2 files changed

+7
-112
lines changed

2 files changed

+7
-112
lines changed

src/backend/common/models/messages_kernel.py

Lines changed: 7 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,20 @@ class Session(BaseDataModel):
101101
current_status: str
102102
message_to_user: Optional[str] = None
103103

104+
104105
class UserCurrentTeam(BaseDataModel):
105106
"""Represents the current team of a user."""
106107

107108
data_type: Literal["user_current_team"] = Field("user_current_team", Literal=True)
108109
user_id: str
109110
team_id: str
110111

112+
111113
class Plan(BaseDataModel):
112114
"""Represents a plan containing multiple steps."""
113115

114116
data_type: Literal["plan"] = Field("plan", Literal=True)
115-
plan_id: str
117+
plan_id: str
116118
session_id: str
117119
user_id: str
118120
initial_goal: str
@@ -122,7 +124,7 @@ class Plan(BaseDataModel):
122124
team_id: Optional[str] = None
123125
human_clarification_request: Optional[str] = None
124126
human_clarification_response: Optional[str] = None
125-
127+
126128

127129
class Step(BaseDataModel):
128130
"""Represents an individual step (task) within a plan."""
@@ -140,24 +142,10 @@ class Step(BaseDataModel):
140142
updated_action: Optional[str] = None
141143

142144

143-
class ThreadIdAgent(BaseDataModel):
144-
"""Represents an individual thread_id."""
145-
146-
data_type: Literal["thread"] = Field("thread", Literal=True)
147-
session_id: str # Partition key
148-
user_id: str
149-
thread_id: str
150-
151-
152-
class AzureIdAgent(BaseDataModel):
153-
"""Represents an individual thread_id."""
145+
class TeamSelectionRequest(KernelBaseModel):
146+
"""Request model for team selection."""
154147

155-
data_type: Literal["agent"] = Field("agent", Literal=True)
156-
session_id: str # Partition key
157-
user_id: str
158-
action: str
159-
agent: AgentType
160-
agent_id: str
148+
team_id: str
161149

162150

163151
class TeamAgent(KernelBaseModel):
@@ -188,9 +176,6 @@ class StartingTask(KernelBaseModel):
188176
creator: str
189177
logo: str
190178

191-
class TeamSelectionRequest(KernelBaseModel):
192-
"""Request model for team selection."""
193-
team_id: str
194179

195180
class TeamConfiguration(BaseDataModel):
196181
"""Represents a team configuration stored in the database."""
@@ -263,80 +248,3 @@ class InputTask(KernelBaseModel):
263248

264249
class UserLanguage(KernelBaseModel):
265250
language: str
266-
267-
268-
class GeneratePlanRequest(KernelBaseModel):
269-
"""Message representing a request to generate a plan from an existing plan ID."""
270-
271-
plan_id: str
272-
273-
274-
class ApprovalRequest(KernelBaseModel):
275-
"""Message sent to HumanAgent to request approval for a step."""
276-
277-
step_id: str
278-
plan_id: str
279-
session_id: str
280-
user_id: str
281-
action: str
282-
agent: AgentType
283-
284-
285-
class HumanFeedback(KernelBaseModel):
286-
"""Message containing human feedback on a step."""
287-
288-
step_id: Optional[str] = None
289-
plan_id: str
290-
session_id: str
291-
approved: bool
292-
human_feedback: Optional[str] = None
293-
updated_action: Optional[str] = None
294-
295-
296-
class HumanClarification(KernelBaseModel):
297-
"""Message containing human clarification on a plan."""
298-
299-
plan_id: str
300-
session_id: str
301-
human_clarification: str
302-
303-
304-
class ActionRequest(KernelBaseModel):
305-
"""Message sent to an agent to perform an action."""
306-
307-
step_id: str
308-
plan_id: str
309-
session_id: str
310-
action: str
311-
agent: AgentType
312-
313-
314-
class ActionResponse(KernelBaseModel):
315-
"""Message containing the response from an agent after performing an action."""
316-
317-
step_id: str
318-
plan_id: str
319-
session_id: str
320-
result: str
321-
status: StepStatus # Should be 'completed' or 'failed'
322-
323-
324-
class PlanStateUpdate(KernelBaseModel):
325-
"""Optional message for updating the plan state."""
326-
327-
plan_id: str
328-
session_id: str
329-
overall_status: PlanStatus
330-
331-
332-
# Define the expected structure of the LLM response
333-
class PlannerResponseStep(KernelBaseModel):
334-
action: str
335-
agent: AgentType
336-
337-
338-
class PlannerResponsePlan(KernelBaseModel):
339-
initial_goal: str
340-
steps: List[PlannerResponseStep]
341-
summary_plan_and_steps: str
342-
human_clarification_request: Optional[str] = None

src/backend/v3/models/orchestration_models.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@
44
from semantic_kernel.kernel_pydantic import Field, KernelBaseModel
55

66

7-
# This will be a dynamic dictionary and will depend on the loaded team definition
8-
class AgentType(str, Enum):
9-
"""Enumeration of agent types."""
10-
11-
HUMAN = "Human_Agent"
12-
HR = "Hr_Agent"
13-
MARKETING = "Marketing_Agent"
14-
PROCUREMENT = "Procurement_Agent"
15-
PRODUCT = "Product_Agent"
16-
GENERIC = "Generic_Agent"
17-
TECH_SUPPORT = "Tech_Support_Agent"
18-
GROUP_CHAT_MANAGER = "Group_Chat_Manager"
19-
PLANNER = "Planner_Agent"
207

218
# Add other agents as needed
229

0 commit comments

Comments
 (0)