# Create a schema file
schema = {
"type": "object",
"properties": {
"summary": {"type": "string"},
"issues": {
"type": "array",
"items": {"type": "string"}
},
"recommendations": {
"type": "array",
"items": {"type": "string"}
}
}
}
# Save schema
import json
with open("schema.json", "w") as f:
json.dump(schema, f)
# Use with Codex
codex = CodexCLIIntegration(
workspace="/project",
output_schema="schema.json"
)
result = await codex.execute_with_schema(
"Analyze code quality",
schema_path="schema.json"
)
print(result)
# {'summary': '...', 'issues': [...], 'recommendations': [...]}