-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix API docs #10268
Fix API docs #10268
Changes from 6 commits
8cbca90
601dd11
ca8d70d
78596b9
779e1b7
0ae21d3
738b33f
8f70cfd
ae0be53
ca55aad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -482,12 +482,55 @@ paths: | |
description: >- | ||
The training data should be in YAML format. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/JSONTrainingRequest' | ||
application/x-yaml: | ||
application/yaml: | ||
schema: | ||
type: string | ||
$ref: '#/components/schemas/YAMLTrainingRequest' | ||
example: | | ||
intents: | ||
- greet | ||
- goodbye | ||
|
||
responses: | ||
utter_greet: | ||
- text: "Hey! How are you?" | ||
|
||
utter_goodbye: | ||
- text: "Bye" | ||
|
||
session_config: | ||
session_expiration_time: 60 | ||
carry_over_slots_to_new_session: true | ||
|
||
pipeline: | ||
|
||
policies: | ||
|
||
nlu: | ||
- intent: greet | ||
examples: | | ||
- hey | ||
- hello | ||
|
||
- intent: goodbye | ||
examples: | | ||
- bye | ||
- goodbye | ||
|
||
rules: | ||
|
||
- rule: Say goodbye anytime the user says goodbye | ||
steps: | ||
- intent: goodbye | ||
- action: utter_goodbye | ||
|
||
stories: | ||
|
||
- story: happy path | ||
steps: | ||
- intent: greet | ||
- action: utter_greet | ||
- intent: goodbye | ||
- action: utter_goodbye | ||
|
||
responses: | ||
200: | ||
|
@@ -718,7 +761,8 @@ paths: | |
summary: Replace the currently loaded model | ||
description: >- | ||
Updates the currently loaded model. | ||
First, tries to load the model from the local storage system. | ||
First, tries to load the model from the local (note: local to Rasa server) | ||
storage system. | ||
Secondly, tries to load the model from the provided model server configuration. | ||
Last, tries to load the model from the provided remote storage. | ||
requestBody: | ||
|
@@ -1052,7 +1096,7 @@ components: | |
model_file: | ||
type: string | ||
description: Path to model file | ||
example: "/models/20190512.tar.gz" | ||
example: "/absolute-path-to-models-directory/models/20190512.tar.gz" | ||
model_server: | ||
$ref: '#/components/schemas/EndpointConfig' | ||
remote_storage: | ||
|
@@ -1407,19 +1451,40 @@ components: | |
type: integer | ||
description: Time to wait between pulls from model server | ||
|
||
JSONTrainingRequest: | ||
YAMLTrainingRequest: | ||
type: object | ||
properties: | ||
domain: | ||
$ref: '#/components/schemas/DomainFile' | ||
config: | ||
$ref: '#/components/schemas/ConfigFile' | ||
intents: | ||
type: array | ||
description: All intent names and properties | ||
items: | ||
$ref: '#/components/schemas/IntentDescription' | ||
responses: | ||
description: Bot response templates | ||
type: object | ||
additionalProperties: | ||
$ref: '#/components/schemas/TemplateDescription' | ||
session_config: | ||
description: Session configuration options | ||
type: object | ||
properties: | ||
session_expiration_time: | ||
type: integer | ||
carry_over_slots_to_new_session: | ||
type: boolean | ||
pipeline: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the change from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joejuzl Similar to domain, request body is flattened, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there no way to include the contents of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried using
to the bottom of the file and referenced it in requestBody as:
I don't see schema and only see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well that second part's schema should not be a list:
Notice the dash is missing. This is still not showing the schema, but instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately I haven't found another way either - Only experimented briefly but ran into the same issues you did @tayfun |
||
description: Pipeline list | ||
type: array | ||
policies: | ||
description: Policies list | ||
nlu: | ||
$ref: '#/components/schemas/NLUTrainingData' | ||
responses: | ||
$ref: '#/components/schemas/RetrievalIntentsTrainingData' | ||
rules: | ||
description: Rule list | ||
type: array | ||
stories: | ||
$ref: '#/components/schemas/StoriesTrainingData' | ||
|
||
force: | ||
type: boolean | ||
description: >- | ||
|
@@ -1432,7 +1497,6 @@ components: | |
If `true` (default) the trained model will be saved in the default model | ||
directory, if `false` it will be saved in a temporary directory | ||
deprecated: True | ||
required: ["config"] | ||
|
||
NLUTrainingData: | ||
type: string | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section should include all properties (missing ones from the domain include actions, entities, e2e_actions, config) and be ordered (IMO) by config.yml, then domain.yml, then the data files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@melindaloubser1 are you sure actions etc. would be handled here? I don't see it in stale docs either: https://rasa.com/docs/rasa/pages/http-api#operation/trainModel I've taken the example and schema from unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't all of this covered by
#/components/schemas/DomainFile
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joejuzl It's not under
domain
anymore, request body is flattened. This is why I've newly added this schema. Also, examples inside schemas do not work for any content type except for JSON in redocly, soexample
keys were removed and a separate example on the same level as schema was added. The other thing is I've simplified the example, previously there were 6 intents in the example request, I've added 2 to show how a list can be sent, I think people can extrapolate that and add more intents if needed.