Skip to content

Commit 74032f4

Browse files
committed
fix: add Gemini-compliant JSON Schema items definitions
Cherry-picked from upstream PR BeehiveInnovations#362 Original author: @ramarivera
1 parent f767f1e commit 74032f4

File tree

7 files changed

+70
-23
lines changed

7 files changed

+70
-23
lines changed

tools/analyze.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,6 @@ def get_input_schema(self) -> dict[str, Any]:
222222
"items": {"type": "string"},
223223
"description": ANALYZE_WORKFLOW_FIELD_DESCRIPTIONS["images"],
224224
},
225-
"issues_found": {
226-
"type": "array",
227-
"items": {"type": "object"},
228-
"description": "Issues or concerns identified during analysis, each with severity level (critical, high, medium, low)",
229-
},
230225
"analysis_type": {
231226
"type": "string",
232227
"enum": ["architecture", "performance", "security", "quality", "general"],

tools/codereview.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,6 @@ def get_input_schema(self) -> dict[str, Any]:
200200
"default": "external",
201201
"description": CODEREVIEW_WORKFLOW_FIELD_DESCRIPTIONS.get("review_validation_type", ""),
202202
},
203-
"issues_found": {
204-
"type": "array",
205-
"items": {"type": "object"},
206-
"description": CODEREVIEW_WORKFLOW_FIELD_DESCRIPTIONS["issues_found"],
207-
},
208203
"images": {
209204
"type": "array",
210205
"items": {"type": "string"},

tools/consensus.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,29 @@ def get_input_schema(self) -> dict[str, Any]:
247247
},
248248
"model_responses": {
249249
"type": "array",
250-
"items": {"type": "object"},
250+
"items": {
251+
"type": "object",
252+
"properties": {
253+
"model": {
254+
"type": "string",
255+
"description": "Model name that provided this response",
256+
},
257+
"stance": {
258+
"type": "string",
259+
"enum": ["for", "against", "neutral"],
260+
"description": "The stance this model was given",
261+
},
262+
"response": {
263+
"type": "string",
264+
"description": "The model's response content",
265+
},
266+
"timestamp": {
267+
"type": "string",
268+
"description": "When the response was received",
269+
},
270+
},
271+
"required": ["model", "response"],
272+
},
251273
"description": CONSENSUS_WORKFLOW_FIELD_DESCRIPTIONS["model_responses"],
252274
},
253275
"images": {

tools/precommit.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@ def get_input_schema(self) -> dict[str, Any]:
201201
"default": "external",
202202
"description": PRECOMMIT_WORKFLOW_FIELD_DESCRIPTIONS["precommit_type"],
203203
},
204-
"issues_found": {
205-
"type": "array",
206-
"items": {"type": "object"},
207-
"description": PRECOMMIT_WORKFLOW_FIELD_DESCRIPTIONS["issues_found"],
208-
},
209204
"images": {
210205
"type": "array",
211206
"items": {"type": "string"},

tools/refactor.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,30 @@ def get_input_schema(self) -> dict[str, Any]:
226226
},
227227
"issues_found": {
228228
"type": "array",
229-
"items": {"type": "object"},
229+
"items": {
230+
"type": "object",
231+
"properties": {
232+
"severity": {
233+
"type": "string",
234+
"enum": ["critical", "high", "medium", "low"],
235+
"description": "Severity level of the issue",
236+
},
237+
"type": {
238+
"type": "string",
239+
"enum": ["codesmells", "decompose", "modernize", "organization"],
240+
"description": "Type of refactoring opportunity",
241+
},
242+
"description": {
243+
"type": "string",
244+
"description": "Description of the refactoring opportunity",
245+
},
246+
"location": {
247+
"type": "string",
248+
"description": "File path or code location",
249+
},
250+
},
251+
"required": ["severity", "description"],
252+
},
230253
"description": REFACTOR_FIELD_DESCRIPTIONS["issues_found"],
231254
},
232255
"images": {

tools/secaudit.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,6 @@ def get_input_schema(self) -> dict[str, Any]:
392392
"enum": ["exploring", "low", "medium", "high", "very_high", "almost_certain", "certain"],
393393
"description": SECAUDIT_WORKFLOW_FIELD_DESCRIPTIONS["confidence"],
394394
},
395-
"issues_found": {
396-
"type": "array",
397-
"items": {"type": "object"},
398-
"description": SECAUDIT_WORKFLOW_FIELD_DESCRIPTIONS["issues_found"],
399-
},
400395
"images": {
401396
"type": "array",
402397
"items": {"type": "string"},

tools/workflow/schema_builders.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,29 @@ class WorkflowSchemaBuilder:
6060
},
6161
"issues_found": {
6262
"type": "array",
63-
"items": {"type": "object"},
63+
"items": {
64+
"type": "object",
65+
"properties": {
66+
"severity": {
67+
"type": "string",
68+
"enum": ["critical", "high", "medium", "low"],
69+
"description": "Severity level of the issue",
70+
},
71+
"description": {
72+
"type": "string",
73+
"description": "Description of the issue found",
74+
},
75+
"location": {
76+
"type": "string",
77+
"description": "File path or code location where the issue was found",
78+
},
79+
"suggestion": {
80+
"type": "string",
81+
"description": "Suggested fix or remediation",
82+
},
83+
},
84+
"required": ["severity", "description"],
85+
},
6486
"description": WORKFLOW_FIELD_DESCRIPTIONS["issues_found"],
6587
},
6688
"confidence": {

0 commit comments

Comments
 (0)