kgauvin603 commited on
Commit
c0308e1
·
verified ·
1 Parent(s): c2632ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -8
app.py CHANGED
@@ -86,7 +86,7 @@ Compare observed vs theoretical. Recommend actions to close the performance gap.
86
  return response.choices[0].message.content.strip()
87
 
88
  class HealthAgent:
89
- def check_health(self, content, llm_model):
90
  cleaned_content = clean_awr_content(content)
91
  if len(cleaned_content) > 128000:
92
  cleaned_content = cleaned_content[:128000] + "\n\n[TRUNCATED]..."
@@ -94,25 +94,41 @@ class HealthAgent:
94
  prompt = f"""
95
  You are the Oracle AWR Health Analysis Agent.
96
 
97
- Your primary responsibility is to detect and report any possible database health risks or failures from the AWR report.
98
 
99
  You MUST:
100
- - Identify all mentions of warnings, failures, critical issues, and alerts.
101
- - Do not omit any mention of failure or warnings, even minor ones.
102
- - Clearly classify them as CRITICAL, WARNING, or INFO.
103
- - Provide suggested actions for CRITICAL and WARNING level issues.
104
  - Always confirm at the end if no CRITICAL or WARNING issues were found.
105
 
 
 
 
 
 
 
 
 
106
  You are NOT allowed to generalize or omit any issue, no matter how small.
107
 
108
- If Flash Cache, I/O, Smart Scan, ASM, Redo log, or RAC interconnect issues are mentioned, they MUST be called out explicitly.
 
 
 
 
 
 
 
 
109
 
110
  AWR CONTENT:
111
  {cleaned_content}
112
  """
113
 
114
  response = client.chat.completions.create(
115
- model=llm_model,
116
  messages=[
117
  {"role": "system", "content": "You are the strict Oracle AWR Health Analysis Agent."},
118
  {"role": "user", "content": prompt}
@@ -121,6 +137,7 @@ AWR CONTENT:
121
 
122
  return response.choices[0].message.content.strip()
123
 
 
124
  class RaterAgent:
125
  def rate(self, content, llm_model):
126
  prompt = f"Rate the following analysis from 1-5 stars and explain:\n\n{content}"
 
86
  return response.choices[0].message.content.strip()
87
 
88
  class HealthAgent:
89
+ def check_health(self, content):
90
  cleaned_content = clean_awr_content(content)
91
  if len(cleaned_content) > 128000:
92
  cleaned_content = cleaned_content[:128000] + "\n\n[TRUNCATED]..."
 
94
  prompt = f"""
95
  You are the Oracle AWR Health Analysis Agent.
96
 
97
+ Your primary responsibility is to detect and report ANY and ALL database health risks, alerts, warnings, or failures in the AWR report.
98
 
99
  You MUST:
100
+ - Identify all issues marked as CRITICAL, WARNING, ALERT, FAILED, OFFLINE, CONFINED, DROPPED, or ERROR.
101
+ - Never omit or generalize. If something appears important, call it out.
102
+ - Classify each issue into: 🚨 CRITICAL / ⚠️ WARNING / INFO
103
+ - For CRITICAL and WARNING, provide suggested actions or considerations.
104
  - Always confirm at the end if no CRITICAL or WARNING issues were found.
105
 
106
+ Special Attention Areas:
107
+ - Flash Cache or Flash Disk Failures (including confined, offline, failed or dropped disks)
108
+ - I/O Subsystem stalls or device errors
109
+ - ASM Disk or Grid Disk issues
110
+ - Smart Scan failures or skipped Smart Scans
111
+ - Redo Log issues (e.g. log file sync slow)
112
+ - RAC Interconnect problems (e.g. gc buffer busy waits, ORA-12170)
113
+
114
  You are NOT allowed to generalize or omit any issue, no matter how small.
115
 
116
+ Specifically analyze Exadata Alerts Summary and Exadata Alerts Detail
117
+
118
+ Example Output:
119
+ 🚨 CRITICAL
120
+ - [issue]
121
+ ⚠️ WARNING
122
+ - [issue]
123
+ ✅ INFO
124
+ - No other warnings or critical issues detected.
125
 
126
  AWR CONTENT:
127
  {cleaned_content}
128
  """
129
 
130
  response = client.chat.completions.create(
131
+ model="gpt-4-turbo",
132
  messages=[
133
  {"role": "system", "content": "You are the strict Oracle AWR Health Analysis Agent."},
134
  {"role": "user", "content": prompt}
 
137
 
138
  return response.choices[0].message.content.strip()
139
 
140
+
141
  class RaterAgent:
142
  def rate(self, content, llm_model):
143
  prompt = f"Rate the following analysis from 1-5 stars and explain:\n\n{content}"