16 #ifndef TENSORFLOW_SERVING_MODEL_SERVERS_TFRT_HTTP_REST_API_HANDLER_H_
17 #define TENSORFLOW_SERVING_MODEL_SERVERS_TFRT_HTTP_REST_API_HANDLER_H_
24 #include "absl/strings/string_view.h"
25 #include "absl/time/time.h"
26 #include "absl/types/optional.h"
28 #include "tensorflow/core/lib/core/status.h"
29 #include "tensorflow/core/protobuf/config.pb.h"
30 #include "tensorflow/core/protobuf/meta_graph.pb.h"
31 #include "tensorflow_serving/model_servers/http_rest_api_handler_base.h"
32 #include "tensorflow_serving/servables/tensorflow/servable.h"
34 namespace tensorflow {
41 class TensorflowPredictor;
72 static const char*
const kPathRegex;
85 Status ProcessRequest(
const absl::string_view http_method,
86 const absl::string_view request_path,
87 const absl::string_view request_body,
88 std::vector<std::pair<string, string>>* headers,
89 string* model_name,
string* method,
90 string* output)
override;
93 Status ProcessClassifyRequest(
94 const absl::string_view model_name,
95 const absl::optional<int64_t>& model_version,
96 const absl::optional<absl::string_view>& model_version_label,
97 const absl::string_view request_body,
99 Status ProcessRegressRequest(
100 const absl::string_view model_name,
101 const absl::optional<int64_t>& model_version,
102 const absl::optional<absl::string_view>& model_version_label,
103 const absl::string_view request_body,
105 Status ProcessPredictRequest(
106 const absl::string_view model_name,
107 const absl::optional<int64_t>& model_version,
108 const absl::optional<absl::string_view>& model_version_label,
109 const absl::string_view request_body,
111 Status ProcessModelStatusRequest(
112 const absl::string_view model_name,
113 const absl::optional<int64_t>& model_version,
114 const absl::optional<absl::string_view>& model_version_label,
116 Status ProcessModelMetadataRequest(
117 const absl::string_view model_name,
118 const absl::optional<int64_t>& model_version,
119 const absl::optional<absl::string_view>& model_version_label,
121 Status GetInfoMap(
const ModelSpec& model_spec,
const string& signature_name,
122 ::google::protobuf::Map<string, tensorflow::TensorInfo>* infomap);
125 absl::Duration timeout_;