Skip to content

Commit 6096c35

Browse files
committed
*
1 parent c17dd9a commit 6096c35

File tree

1 file changed

+8
-67
lines changed

1 file changed

+8
-67
lines changed

modus/functions.mdx

Lines changed: 8 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ func GatherThreatIntelligence(source string) (*ThreatReport, error) {
5252
// Intelligence gathering operation
5353
return fetchThreatData(source)
5454
}
55-
56-
// This function becomes a GraphQL query
57-
func AnalyzeSecurityPatterns() (*SecurityAssessment, error) {
58-
// Analysis operation using AI models
59-
return generateSecurityAnalysis()
60-
}
6155
```
6256

6357
Your operatives are now accessible via GraphQL:
@@ -69,12 +63,6 @@ query {
6963
indicators
7064
recommendations
7165
}
72-
73-
analyzeSecurityPatterns {
74-
riskScore
75-
anomalies
76-
actionItems
77-
}
7866
}
7967
```
8068

@@ -87,11 +75,6 @@ query {
8775
"threatLevel": "HIGH",
8876
"indicators": ["unusual_traffic", "failed_auth_attempts"],
8977
"recommendations": ["immediate_investigation", "block_suspicious_ips"]
90-
},
91-
"analyzeSecurityPatterns": {
92-
"riskScore": 8.5,
93-
"anomalies": ["off_hours_access", "geographic_anomaly"],
94-
"actionItems": ["verify_user_identity", "enable_2fa"]
9578
}
9679
}
9780
}
@@ -108,55 +91,6 @@ func CreateSecurityAlert(data AlertInput) (*SecurityAlert, error) {
10891
// Create new security alert
10992
return deploySecurityAlert(data)
11093
}
111-
112-
// This becomes a GraphQL mutation
113-
func UpdateThreatLevel(id string, level string) (*ThreatAssessment, error) {
114-
// Update threat assessment
115-
return modifyThreatRecord(id, level)
116-
}
117-
```
118-
119-
Now you can execute operational changes:
120-
121-
```graphql
122-
mutation {
123-
createSecurityAlert(
124-
data: {
125-
type: "INTRUSION_ATTEMPT"
126-
severity: "CRITICAL"
127-
source: "firewall_logs"
128-
}
129-
) {
130-
alertId
131-
status
132-
timestamp
133-
}
134-
135-
updateThreatLevel(id: "threat_001", level: "CRITICAL") {
136-
id
137-
newLevel
138-
escalated
139-
}
140-
}
141-
```
142-
143-
**Response:**
144-
145-
```json
146-
{
147-
"data": {
148-
"createSecurityAlert": {
149-
"alertId": "alert_20250115_001",
150-
"status": "ACTIVE",
151-
"timestamp": "2025-01-15T14:30:00Z"
152-
},
153-
"updateThreatLevel": {
154-
"id": "threat_001",
155-
"newLevel": "CRITICAL",
156-
"escalated": true
157-
}
158-
}
159-
}
16094
```
16195

16296
Functions starting with `create`, `update`, `delete`, and similar action words
@@ -317,10 +251,17 @@ To use this function, you'll need to:
317251

318252
Sign up for a free API key at [OpenWeatherMap](https://openweathermap.org/api)
319253

320-
Add the connection to your `modus.json`:
254+
Add the connections and models to your `modus.json`:
321255

322256
```json
323257
{
258+
"models": {
259+
"text-generator": {
260+
"sourceModel": "meta-llama/Llama-3.2-3B-Instruct",
261+
"provider": "hugging-face",
262+
"connection": "hypermode"
263+
}
264+
},
324265
"connections": {
325266
"weather-api": {
326267
"type": "http",

0 commit comments

Comments
 (0)