put-trained-model.asciidoc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --
  2. :api: put-trained-model
  3. :request: PutTrainedModelRequest
  4. :response: PutTrainedModelResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Create trained models API
  9. Creates a new trained model for inference.
  10. The API accepts a +{request}+ object as a request and returns a +{response}+.
  11. [id="{upid}-{api}-request"]
  12. ==== Request
  13. A +{request}+ requires the following argument:
  14. ["source","java",subs="attributes,callouts,macros"]
  15. --------------------------------------------------
  16. include-tagged::{doc-tests-file}[{api}-request]
  17. --------------------------------------------------
  18. <1> The configuration of the {infer} trained model to create
  19. [id="{upid}-{api}-config"]
  20. ==== Trained model configuration
  21. The `TrainedModelConfig` object contains all the details about the trained model
  22. configuration and contains the following arguments:
  23. ["source","java",subs="attributes,callouts,macros"]
  24. --------------------------------------------------
  25. include-tagged::{doc-tests-file}[{api}-config]
  26. --------------------------------------------------
  27. <1> The {infer} definition for the model
  28. <2> Optionally, if the {infer} definition is large, you may choose to compress it for transport.
  29. Do not supply both the compressed and uncompressed definitions.
  30. <3> The unique model id
  31. <4> The input field names for the model definition
  32. <5> Optionally, a human-readable description
  33. <6> Optionally, an object map contain metadata about the model
  34. <7> Optionally, an array of tags to organize the model
  35. <8> The default inference config to use with the model. Must match the underlying
  36. definition target_type.
  37. include::../execution.asciidoc[]
  38. [id="{upid}-{api}-response"]
  39. ==== Response
  40. The returned +{response}+ contains the newly created trained model.
  41. The +{response}+ will omit the model definition as a precaution against
  42. streaming large model definitions back to the client.
  43. ["source","java",subs="attributes,callouts,macros"]
  44. --------------------------------------------------
  45. include-tagged::{doc-tests-file}[{api}-response]
  46. --------------------------------------------------