@@ -874,8 +874,6 @@ class EmbeddingRequest(BaseModel):
874
874
model : str = Field ("default" , description = "Embedding model to use" )
875
875
collection_name : Optional [str ] = Field (None , description = "Target collection" )
876
876
metadata : Optional [List [Dict [str , Any ]]] = Field (None , description = "Metadata for each text" )
877
-
878
-
879
877
class EmbeddingResponse (BaseModel ):
880
878
"""Response from embedding generation."""
881
879
embeddings : List [List [float ]] = Field (..., description = "Generated embeddings" )
@@ -884,3 +882,99 @@ class EmbeddingResponse(BaseModel):
884
882
token_count : Optional [int ] = Field (None , description = "Total token count processed" )
885
883
886
884
885
+ # =============================================================================
886
+ # Phase 4 HTTP Endpoint Management Models
887
+ # =============================================================================
888
+
889
+ class HttpMethod (str , Enum ):
890
+ """HTTP method enumeration."""
891
+ GET = "GET"
892
+ POST = "POST"
893
+ PUT = "PUT"
894
+ DELETE = "DELETE"
895
+ PATCH = "PATCH"
896
+ HEAD = "HEAD"
897
+ OPTIONS = "OPTIONS"
898
+
899
+
900
+ class EndpointStatus (str , Enum ):
901
+ """HTTP endpoint status enumeration."""
902
+ ACTIVE = "active"
903
+ INACTIVE = "inactive"
904
+ MAINTENANCE = "maintenance"
905
+ ERROR = "error"
906
+
907
+
908
+ class HttpEndpointCreateRequest (BaseModel ):
909
+ """Request to create a new HTTP endpoint."""
910
+ path : str = Field (..., description = "Endpoint path" )
911
+ method : HttpMethod = Field (..., description = "HTTP method" )
912
+ agent_id : str = Field (..., description = "Agent to handle requests" )
913
+ description : Optional [str ] = Field (None , description = "Endpoint description" )
914
+ auth_required : bool = Field (True , description = "Whether authentication is required" )
915
+ rate_limit : Optional [int ] = Field (None , description = "Rate limit per minute" )
916
+ timeout_seconds : int = Field (30 , description = "Request timeout in seconds" )
917
+ middleware : List [str ] = Field (default_factory = list , description = "Middleware to apply" )
918
+ metadata : Dict [str , Any ] = Field (default_factory = dict , description = "Additional endpoint metadata" )
919
+
920
+
921
+ class HttpEndpointUpdateRequest (BaseModel ):
922
+ """Request to update an existing HTTP endpoint."""
923
+ endpoint_id : str = Field (..., description = "Endpoint identifier" )
924
+ path : Optional [str ] = Field (None , description = "Endpoint path" )
925
+ method : Optional [HttpMethod ] = Field (None , description = "HTTP method" )
926
+ agent_id : Optional [str ] = Field (None , description = "Agent to handle requests" )
927
+ description : Optional [str ] = Field (None , description = "Endpoint description" )
928
+ auth_required : Optional [bool ] = Field (None , description = "Whether authentication is required" )
929
+ rate_limit : Optional [int ] = Field (None , description = "Rate limit per minute" )
930
+ timeout_seconds : Optional [int ] = Field (None , description = "Request timeout in seconds" )
931
+ status : Optional [EndpointStatus ] = Field (None , description = "Endpoint status" )
932
+ middleware : Optional [List [str ]] = Field (None , description = "Middleware to apply" )
933
+ metadata : Optional [Dict [str , Any ]] = Field (None , description = "Additional endpoint metadata" )
934
+
935
+
936
+ class EndpointMetrics (BaseModel ):
937
+ """HTTP endpoint metrics."""
938
+ endpoint_id : str = Field (..., description = "Endpoint identifier" )
939
+ total_requests : int = Field (..., description = "Total number of requests" )
940
+ successful_requests : int = Field (..., description = "Number of successful requests" )
941
+ failed_requests : int = Field (..., description = "Number of failed requests" )
942
+ average_response_time_ms : float = Field (..., description = "Average response time in milliseconds" )
943
+ max_response_time_ms : float = Field (..., description = "Maximum response time in milliseconds" )
944
+ min_response_time_ms : float = Field (..., description = "Minimum response time in milliseconds" )
945
+ requests_per_minute : float = Field (..., description = "Current requests per minute rate" )
946
+ error_rate_percent : float = Field (..., description = "Error rate percentage" )
947
+ last_request_at : Optional [datetime ] = Field (None , description = "Timestamp of last request" )
948
+ uptime_seconds : int = Field (..., description = "Endpoint uptime in seconds" )
949
+
950
+
951
+ class HttpEndpointInfo (BaseModel ):
952
+ """HTTP endpoint information."""
953
+ endpoint_id : str = Field (..., description = "Endpoint identifier" )
954
+ path : str = Field (..., description = "Endpoint path" )
955
+ method : HttpMethod = Field (..., description = "HTTP method" )
956
+ agent_id : str = Field (..., description = "Agent handling requests" )
957
+ description : Optional [str ] = Field (None , description = "Endpoint description" )
958
+ status : EndpointStatus = Field (..., description = "Current endpoint status" )
959
+ auth_required : bool = Field (..., description = "Whether authentication is required" )
960
+ rate_limit : Optional [int ] = Field (None , description = "Rate limit per minute" )
961
+ timeout_seconds : int = Field (..., description = "Request timeout in seconds" )
962
+ middleware : List [str ] = Field (default_factory = list , description = "Applied middleware" )
963
+ created_at : datetime = Field (..., description = "Endpoint creation timestamp" )
964
+ updated_at : datetime = Field (..., description = "Last update timestamp" )
965
+ created_by : str = Field (..., description = "User who created the endpoint" )
966
+ metrics : Optional [EndpointMetrics ] = Field (None , description = "Endpoint metrics" )
967
+ metadata : Dict [str , Any ] = Field (default_factory = dict , description = "Additional endpoint metadata" )
968
+
969
+
970
+ class HttpEndpointResponse (BaseModel ):
971
+ """Response from HTTP endpoint operations."""
972
+ endpoint_id : str = Field (..., description = "Endpoint identifier" )
973
+ status : str = Field (..., description = "Operation status" )
974
+ message : Optional [str ] = Field (None , description = "Operation message" )
975
+ endpoint_info : Optional [HttpEndpointInfo ] = Field (None , description = "Endpoint information" )
976
+ created_at : Optional [datetime ] = Field (None , description = "Creation timestamp" )
977
+
978
+
979
+
980
+
0 commit comments