Skip to content

Commit 2a714ed

Browse files
committed
PR CHANGES
1 parent 4f7ada5 commit 2a714ed

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/robusta/core/model/base_params.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,23 @@ class ConversationType(str, Enum):
182182
ISSUE = "issue"
183183

184184

185+
class HolmesChatSource(str, Enum):
186+
"""
187+
Conversation types for holmes_conversation action
188+
"""
189+
190+
UI = "ui"
191+
RELAY = "relay"
192+
193+
185194
class HolmesChatParams(HolmesParams):
186195
"""
187196
:var ask: User's prompt for holmes
188197
"""
189198

190199
ask: str
191200
conversation_history: Optional[list[dict]] = None
192-
from_chatbot: bool = False
201+
source: HolmesChatSource = HolmesChatSource.UI
193202

194203

195204
class HolmesIssueChatParams(HolmesChatParams):

src/robusta/core/playbooks/internal/ai_integration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
AIInvestigateParams,
99
ChartValuesFormat,
1010
HolmesChatParams,
11+
HolmesChatSource,
1112
HolmesConversationParams,
1213
HolmesIssueChatParams,
1314
HolmesWorkloadHealthChatParams,
@@ -354,7 +355,7 @@ def holmes_chat(event: ExecutionBaseEvent, params: HolmesChatParams):
354355
result.raise_for_status()
355356
holmes_result = HolmesChatResult(**json.loads(result.text))
356357
holmes_result.files = []
357-
if params.from_chatbot:
358+
if params.source == HolmesChatSource.RELAY:
358359
for tool in holmes_result.tool_calls:
359360
if tool.tool_name != "execute_prometheus_range_query":
360361
continue

0 commit comments

Comments
 (0)