Version: Latest

Model Download API for CI Integration

Introduction

The Model Download API provides external access to retrieve download URLs for artifacts generated in Rasa Studio, facilitating CI/CD integration. Built with GraphQL, this API allows queries to request trained assistant models and associated input data in YAML format.

Requirements

Available APIs

Query: ModelDownloadUrls

Schema:

type Query {
modelDownloadUrls(input: ModelDownloadUrlsInput!): ModelDownloadUrlsOutput!
}
input ModelDownloadUrlsInput {
assistantId: ID!
assistantVersionName: ID
}
type ModelDownloadUrlsOutput {
modelFileUrl: String!
modelInputUrl: String!
}

Input: ModelDownloadUrlsInput

FieldDescription
assistantIdUnique identifier of the assistant.
assistantVersionNameOptional version of the trained assistant. Default is latest.

Output: ModelDownloadUrlsOutput

FieldDescription
modelFileUrlUrl to download the model file model.tar.gz.
modelInputUrlUrl to download the model input data in YAML format.

Usage

The query can be used to fetch the download URLs for the trained model and the input data in YAML format for a assistant.

Example curl Request

Request the Model Download API using e.g. curl:

curl -X POST https://<your-api-url>/api/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-access-token>" \
-d '{
"query": "query ModelDownloadUrls($input: ModelDownloadUrlsInput!) { modelDownloadUrls(input: $input) { modelFileUrl modelInputUrl } }",
"variables": {
"input": {
"assistantId": "<your-assistant-id>",
"assistantVersionName": "<your-assistant-version-name>"
}
}
}'

Example Response

The response will contain the download URLs for the trained model and the model input data.

{"data":
{"modelDownloadUrls":
{
"modelFileUrl":"<your-model-file-url>",
"modelInputUrl":"<your-model-input-url>"
}
}
}

Download files

Download the model and input data files using the URLs provided in the response.

curl -L -o model.tar.gz "<your-model-file-url>"
curl -L -o bot_config.tar.gz "<your-model-input-url>"

The downloaded model file model.tar.gz can be used to deploy the trained model to a Rasa server.

The downloaded model input data bot_config.tar.gz contains the input data in YAML format:

  • data/flows.yml
  • data/nlu.yml
  • config.yml
  • credentials.yml
  • domain.yml
  • endpoints.yml