Files
goclaw/tests/contracts/schemas/http_chat_completions.json
viettranx 6e7e15cf4a test(contracts): complete P1 contract tests with schemas and policy
- Add config.get, skills.list WS contract tests
- Add /v1/providers HTTP contract test
- Add JSON schemas for ws_connect, ws_chat_send, http_chat_completions
- Document breaking change policy
2026-04-12 21:52:29 +07:00

41 lines
1.1 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "POST /v1/chat/completions response (OpenAI-compatible)",
"type": "object",
"required": ["id", "object", "created", "model", "choices"],
"properties": {
"id": { "type": "string" },
"object": { "type": "string", "const": "chat.completion" },
"created": { "type": "number" },
"model": { "type": "string" },
"choices": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["index", "message", "finish_reason"],
"properties": {
"index": { "type": "number" },
"message": {
"type": "object",
"required": ["role", "content"],
"properties": {
"role": { "type": "string" },
"content": { "type": "string" }
}
},
"finish_reason": { "type": "string" }
}
}
},
"usage": {
"type": "object",
"properties": {
"prompt_tokens": { "type": "number" },
"completion_tokens": { "type": "number" },
"total_tokens": { "type": "number" }
}
}
}
}