Skip to content

Commit 5cb2ee7

Browse files
Add learning parameter API changes (#85)
* Add learning parameter API changes * Apply suggestions from code review Co-authored-by: Luke Kim <80174+lukekim@users.noreply.github.com> Co-authored-by: Luke Kim <80174+lukekim@users.noreply.github.com>
1 parent d3f7890 commit 5cb2ee7

1 file changed

Lines changed: 64 additions & 1 deletion

File tree

spiceaidocs/static/openapi/spiceai.yaml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: "3.0.3"
22
info:
33
description: ""
4-
version: "0.3.1-alpha"
4+
version: "0.4.1-alpha"
55
title: "Spice.ai"
66
servers:
77
- url: http://localhost:8000/api/v0.1
@@ -81,6 +81,21 @@ paths:
8181
required: true
8282
schema:
8383
type: "string"
84+
requestBody:
85+
description: "The configurable parameters for a training run"
86+
required: false
87+
content:
88+
application/json:
89+
schema:
90+
$ref: "#/components/schemas/TrainRequest"
91+
examples:
92+
dql-example:
93+
summary: Start a training run with 5 episodes and the DQL learning agent
94+
value: |
95+
{
96+
"learning_algorithm": "dql",
97+
"number_episodes": 5
98+
}
8499
responses:
85100
"200":
86101
description: "Pod started training"
@@ -736,6 +751,33 @@ paths:
736751
}
737752
"404":
738753
description: "Pod not found"
754+
/algorithms:
755+
get:
756+
tags:
757+
- "train"
758+
responses:
759+
"200":
760+
description: Returns a list of the available ML learning algorithms.
761+
content:
762+
application/json:
763+
schema:
764+
type: "array"
765+
items:
766+
$ref: "#/components/schemas/LearningAlgorithm"
767+
example:
768+
[
769+
{
770+
"algorithm_id": "dql",
771+
"name": "Deep Q-Learning",
772+
"docs_link": "https://docs.spiceai.org/deep-learning-ai/dql/",
773+
},
774+
{
775+
"algorithm_id": "vpg",
776+
"name": "Vanilla Policy Gradient",
777+
"docs_link": "https://docs.spiceai.org/deep-learning-ai/vpg/",
778+
},
779+
]
780+
739781
components:
740782
schemas:
741783
Pod:
@@ -828,6 +870,27 @@ components:
828870
archive_path:
829871
type: "string"
830872
description: "Path to the .spicepod archive to import"
873+
TrainRequest:
874+
type: "object"
875+
properties:
876+
learning_algorithm:
877+
type: "string"
878+
description: "The learning algorithm id to use in the requested training run"
879+
number_episodes:
880+
type: "integer"
881+
format: "int64"
882+
LearningAlgorithm:
883+
type: "object"
884+
properties:
885+
algorithm_id:
886+
type: "string"
887+
description: "The AI learning algorithm identifier"
888+
name:
889+
type: "string"
890+
description: "The AI learning algorithm name. i.e. Deep Q-Learning"
891+
docs_link:
892+
type: "string"
893+
description: "Link to Spice.ai docs where you can learn more about the algorithm"
831894
TrainingRun:
832895
type: "object"
833896
properties:

0 commit comments

Comments
 (0)