Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ai): add AI-based issue interpretation feature #707

Merged
merged 10 commits into from
Jan 9, 2025
159 changes: 127 additions & 32 deletions api/openapispec/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,70 @@ var doc = `{
}
}
},
"/insight/issue/interpret/stream": {
"post": {
"description": "This endpoint analyzes scanner issues using AI to provide detailed interpretation and insights",
"consumes": [
"application/json"
],
"produces": [
"text/event-stream"
],
"tags": [
"insight"
],
"summary": "Interpret scanner issues using AI",
"parameters": [
{
"description": "The audit data to interpret",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/scanner.InterpretRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ai.InterpretEvent"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "string"
}
},
"429": {
"description": "Too Many Requests",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/insight/yaml/interpret/stream": {
"post": {
"description": "This endpoint analyzes YAML content using AI to provide detailed interpretation and insights",
Expand Down Expand Up @@ -413,6 +477,24 @@ var doc = `{
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "string"
}
},
"429": {
"description": "Too Many Requests",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
Expand Down Expand Up @@ -969,7 +1051,7 @@ var doc = `{
"200": {
"description": "Audit results",
"schema": {
"$ref": "#/definitions/scanner.AuditData"
"$ref": "#/definitions/ai.AuditData"
}
},
"400": {
Expand Down Expand Up @@ -2067,6 +2149,29 @@ var doc = `{
}
}
},
"ai.AuditData": {
"type": "object",
"properties": {
"bySeverity": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"issueGroups": {
"type": "array",
"items": {
"$ref": "#/definitions/ai.IssueGroup"
}
},
"issueTotal": {
"type": "integer"
},
"resourceTotal": {
"type": "integer"
}
}
},
"ai.DiagnosisEvent": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2116,6 +2221,20 @@ var doc = `{
}
}
},
"ai.IssueGroup": {
"type": "object",
"properties": {
"issue": {
"$ref": "#/definitions/scanner.Issue"
},
"resourceGroups": {
"type": "array",
"items": {
"$ref": "#/definitions/entity.ResourceGroup"
}
}
}
},
"cluster.ClusterPayload": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2296,26 +2415,16 @@ var doc = `{
}
}
},
"scanner.AuditData": {
"scanner.InterpretRequest": {
"type": "object",
"properties": {
"bySeverity": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"issueGroups": {
"type": "array",
"items": {
"$ref": "#/definitions/scanner.IssueGroup"
}
},
"issueTotal": {
"type": "integer"
"auditData": {
"description": "The audit data to interpret",
"$ref": "#/definitions/ai.AuditData"
},
"resourceTotal": {
"type": "integer"
"language": {
"description": "Language for interpretation",
"type": "string"
}
}
},
Expand All @@ -2340,20 +2449,6 @@ var doc = `{
}
}
},
"scanner.IssueGroup": {
"type": "object",
"properties": {
"issue": {
"$ref": "#/definitions/scanner.Issue"
},
"resourceGroups": {
"type": "array",
"items": {
"$ref": "#/definitions/entity.ResourceGroup"
}
}
}
},
"unstructured.Unstructured": {
"type": "object",
"properties": {
Expand Down
Loading
Loading