Skip to content

Commit

Permalink
Merge pull request #395 from fitztrev/schema-cloud-eval
Browse files Browse the repository at this point in the history
Add schema for cloud eval response
  • Loading branch information
fitztrev authored Nov 17, 2024
2 parents 8507dc9 + 50f950b commit c01f2cf
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 12 deletions.
44 changes: 44 additions & 0 deletions doc/specs/schemas/CloudEval.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
type: object

properties:
depth:
type: integer
fen:
type: string
knodes:
type: integer
pvs:
type: array
items:
type: object
properties:
cp:
type: integer
description: Evaluation in centi-pawns, from White's point of view
mate:
type: integer
description: Evaluation in moves to mate, from White's point of view
moves:
type: string
description: Variation in UCI notation

example:
{
"depth": 29,
"fen": "r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R",
"knodes": 106325,
"pvs": [
{
"cp": 41,
"moves": "d1e2 d8e7 a2a4 a7a6 b5c4 d7d6 d2d3 g8f6 c1e3 c6a5"
},
{
"cp": 39,
"moves": "c2c3 a7a6 b5a4 g8f6 d2d3 b7b5 a4b3 h7h6 a2a4 c8b7"
},
{
"cp": 37,
"moves": "d2d3 d8f6 c2c3 a7a6 b5a4 f8c5 d3d4 c5a7 c1e3 g8e7"
}
]
}
14 changes: 3 additions & 11 deletions doc/specs/tags/analysis/api-cloud-eval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ get:
description: FEN of the position
schema:
type: string
example: rnbqkbnr/ppp1pppp/8/3pP3/8/8/PPPP1PPP/RNBQKBNR b KQkq - 0 2
example: r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R b KQkq - 3 3
- in: query
name: multiPv
description: Number of variations
Expand All @@ -39,16 +39,8 @@ get:
default: "'*'"
content:
application/json:
example: {
"fen": "rnbqkbnr/ppp1pppp/8/3pP3/8/8/PPPP1PPP/RNBQKBNR b KQkq - 0 2",
"knodes": 13683,
"depth": 22,
"pvs": [
{"moves": "c8f5 d2d4 e7e6 g1f3 g8e7 c1e3 c7c5 d4c5 e7c6 b1c3", "cp": -13},
{"moves": "c7c5 c2c3 d5d4 g1f3 b8c6 c3d4 c6d4 b1c3 c8d7 f1d3", "cp": -1},
{"moves": "e7e6 d2d4 c7c5 c2c3 b8c6 g1f3 c8d7 b1a3 c5d4 c3d4", "cp": 24}
]
}
schema:
$ref: "../../schemas/CloudEval.yaml"
"404":
description: The position was not found in the cloud evaluation database.
content:
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/studies/api-study-studyId.pgn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ head:
schema:
type: string
responses:
"200":
"204":
description: The study headers.
headers:
Access-Control-Allow-Origin:
Expand Down

0 comments on commit c01f2cf

Please sign in to comment.