Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/configuration/holmesgpt/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,46 @@ Choose an AI provider below and follow the instructions:

Run a :ref:`Helm Upgrade <Simple Upgrade>` to apply the configuration.

.. tab-item:: Multiple providers
:name: multiple-providers

Starting from version *0.22.1*, Robusta supports an alternative way to configure AI models: using a YAML dictionary in your Helm values file.

This method allows you to configure multiple models at once, each with its own parameters.

Update your Helm values (``generated_values.yaml`` file) with the following configuration.

When multiple models are defined, the Robusta UI will allow users to choose a specific model when initiating an AI-based investigation.

.. admonition:: Model info
:class: warning

When using multiple providers, the keys differ slightly from the single-provider case.

.. code-block:: yaml

enableHolmesGPT: true

holmes:
modelList: # sample configuration.
openai:
model: openai/gpt-4o
api_key: "{{ env.API_KEY }}"
azure-low-budget:
model : azure/team-low-budget
api_base : <your-api-base> # fill in the base endpoint url of your azure deployment - e.g. https://my-org.openai.azure.com/
api_version : "2024-06-01"
api_key : "{{ env.AZURE_API_KEY }}" # you can load the values from an environment variable as well.
temperature: 0
bedrock-devops:
model: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0 # your bedrock model.
aws_region_name: us-east-1
aws_access_key_id: "{{ env.AWS_ACCESS_KEY_ID }}" # you can load the values from an environment variable as well.
aws_secret_access_key: <your-aws-secret-access-key>
thinking: {"type": "enabled", "budget_tokens": 1024}

Run a :ref:`Helm Upgrade <Simple Upgrade>` to apply the configuration.

Configuring HolmesGPT Access to SaaS Data
----------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion src/robusta/core/model/base_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ResourceInfo(BaseModel):
class HolmesParams(ActionParams):

holmes_url: Optional[str]

model: Optional[str]
@validator("holmes_url", allow_reuse=True)
def validate_protocol(cls, v):
if v and not v.startswith("http"): # if the user configured url without http(s)
Expand Down Expand Up @@ -251,6 +251,7 @@ class HolmesWorkloadHealthChatParams(HolmesParams):
conversation_history: Optional[list[dict]] = None



class NamespacedResourcesParams(ActionParams):
"""
:var name: Resource name
Expand Down
11 changes: 7 additions & 4 deletions src/robusta/core/playbooks/internal/ai_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def ask_holmes(event: ExecutionBaseEvent, params: AIInvestigateParams):
context=params.context if params.context else {},
include_tool_calls=True,
include_tool_call_results=True,
sections=params.sections
sections=params.sections,
model=params.model
)

if params.stream:
Expand Down Expand Up @@ -287,6 +288,7 @@ def holmes_issue_chat(event: ExecutionBaseEvent, params: HolmesIssueChatParams):
conversation_history=params.conversation_history,
investigation_result=params.context.investigation_result,
issue_type=params.context.issue_type,
model=params.model
)
result = requests.post(f"{holmes_url}/api/issue_chat", data=holmes_req.json())
result.raise_for_status()
Expand Down Expand Up @@ -336,7 +338,7 @@ def holmes_chat(event: ExecutionBaseEvent, params: HolmesChatParams):
cluster_name = event.get_context().cluster_name

try:
holmes_req = HolmesChatRequest(ask=params.ask, conversation_history=params.conversation_history)
holmes_req = HolmesChatRequest(ask=params.ask, conversation_history=params.conversation_history, model=params.model)
result = requests.post(f"{holmes_url}/api/chat", data=holmes_req.json())
result.raise_for_status()
holmes_result = HolmesChatResult(**json.loads(result.text))
Expand Down Expand Up @@ -380,11 +382,12 @@ def holmes_workload_chat(event: ExecutionBaseEvent, params: HolmesWorkloadHealth
ask=params.ask,
conversation_history=params.conversation_history,
workload_health_result=params.workload_health_result,
resource=params.resource
resource=params.resource,
model=params.model
)
result = requests.post(f"{holmes_url}/api/workload_health_chat", data=holmes_req.json())
result.raise_for_status()

holmes_result = HolmesChatResult(**json.loads(result.text))

finding = Finding(
Expand Down
2 changes: 2 additions & 0 deletions src/robusta/core/reporting/holmes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class HolmesRequest(BaseModel):
include_tool_calls: bool = False
include_tool_call_results: bool = False
sections: Optional[Dict[str, str]] = None
model: Optional[str] = None


class HolmesConversationRequest(BaseModel):
Expand All @@ -35,6 +36,7 @@ class HolmesConversationRequest(BaseModel):
class HolmesChatRequest(BaseModel):
ask: str
conversation_history: Optional[List[dict]] = None
model: Optional[str] = None


class HolmesIssueChatRequest(HolmesChatRequest):
Expand Down
Loading