1
0

put-trained-model.asciidoc 2.0 KB

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