put-trained-model.asciidoc 2.1 KB

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