// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////

syntax = "proto3";

package magenta;

// Details about a Generator.
message GeneratorDetails {
  // A unique ID for the generator on this server.
  string id = 1;
  // A short, human-readable description of the generator.
  string description = 2;
}

// Options for generating a sequence.
message GeneratorOptions {
  message SequenceSection {
    // Start time for the section in seconds, inclusive.
    double start_time = 1;
    // End time for the section in seconds, exclusive.
    double end_time = 2;
  }
  // Sections of input sequence to condition on.
  repeated SequenceSection input_sections = 1;
  // Sections of sequence to generate.
  repeated SequenceSection generate_sections = 2;

  // Map of argument name to argument value for additional arguments.
  // Generators should ignore unsupported arguments.
  message ArgValue {
    // Each argument value can be exactly one kind. The "bytes" kind is intended
    // for arbitrary serialized data, while the "string" kind is intended for
    // text strings.
    oneof kind {
      bytes byte_value = 1;
      int32 int_value = 2;
      double float_value = 3;
      bool bool_value = 4;
      string string_value = 5;
    }
  }
  map<string, ArgValue> args = 3;
}

// Bundle for wrapping a generator id, checkpoint file, and metagraph.
// Intended to make sharing pre-trained models easier.
// Next ID: 5
message GeneratorBundle {
  // Details about the generator that created this bundle.
  GeneratorDetails generator_details = 1;

  // Details about this specific bundle.
  message BundleDetails {
    // A short, human-readable text description of the bundle (e.g., training
    // data, hyper parameters, etc.).
    string description = 1;
  }
  BundleDetails bundle_details = 4;

  // The contents of the checkpoint file generated by the Saver.
  // This is a repeated field so we can eventually support sharded checkpoints.
  // But for now, we support only 1 file.
  repeated bytes checkpoint_file = 2;

  // The contents of the metagraph file generated by the Saver.
  bytes metagraph_file = 3;
}
