Skip to content

Commit dd245b1

Browse files
committed
Revise proposed HTTP infrastructure as part of extenders API.
1 parent 8a200f7 commit dd245b1

File tree

1 file changed

+41
-20
lines changed

1 file changed

+41
-20
lines changed

docs/ARCHITECTURE.md

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -810,14 +810,6 @@ direction LR
810810
}
811811
812812
namespace AiClientNamespace.Providers.Contracts {
813-
class AuthenticationInterface {
814-
+authenticate(Request $request) void
815-
+getJsonSchema() array< string, mixed >$
816-
}
817-
class HttpClientInterface {
818-
+send(Request $request, array< string, mixed > $options) Response
819-
+request(string $method, string $uri, array< string, mixed > $options) Response
820-
}
821813
class ModelMetadataDirectoryInterface {
822814
+listModelMetadata() ModelMetadata[]
823815
+hasModelMetadata(string $modelId) bool
@@ -866,23 +858,52 @@ direction LR
866858
}
867859
}
868860
861+
namespace AiClientNamespace.Providers.Http.Contracts {
862+
class HttpTransporterInterface {
863+
+send(Request $request) Response
864+
}
865+
class RequestAuthenticationInterface {
866+
+authenticate(Request $request) void
867+
+getJsonSchema() array< string, mixed >$
868+
}
869+
class WithHttpTransporterInterface {
870+
+setHttpTransporter(HttpTransporterInterface $transporter) void
871+
+getHttpTransporter() HttpTransporterInterface
872+
}
873+
class WithRequestAuthenticationInterface {
874+
+setRequestAuthentication(RequestAuthenticationInterface $authentication) void
875+
+getRequestAuthentication() RequestAuthenticationInterface
876+
}
877+
}
878+
879+
namespace AiClientNamespace.Providers.Http.DTO {
880+
class Request {
881+
+getMethod() string
882+
+getUri() string
883+
+getHeaders() array< string, string[] >
884+
+getBody() ?string
885+
+getData() ?array< string, mixed >
886+
+getJsonSchema() array< string, mixed >$
887+
}
888+
889+
class Response {
890+
+getStatusCode() int
891+
+getHeaders() array< string, string[] >
892+
+getBody() ?string
893+
+getData() ?array< string, mixed >
894+
+getJsonSchema() array< string, mixed >$
895+
}
896+
}
897+
869898
namespace AiClientNamespace.Providers.Models.Contracts {
870899
class ModelInterface {
871900
+metadata() ModelMetadata
872901
+setConfig(ModelConfig $config) void
873902
+getConfig() ModelConfig
874903
}
875-
class WithAuthenticationInterface {
876-
+setAuthentication(AuthenticationInterface $authentication) void
877-
+getAuthentication() AuthenticationInterface
878-
}
879904
class WithEmbeddingOperationsInterface {
880905
+getOperation(string $operationId) EmbeddingOperation
881906
}
882-
class WithHttpClientInterface {
883-
+setHttpClient(HttpClientInterface $client) void
884-
+getHttpClient() HttpClientInterface
885-
}
886907
}
887908
888909
namespace AiClientNamespace.Providers.Models.DTO {
@@ -1051,10 +1072,10 @@ direction LR
10511072
<<interface>> TextToSpeechConversionOperationModelInterface
10521073
<<interface>> SpeechGenerationOperationModelInterface
10531074
<<interface>> EmbeddingGenerationOperationModelInterface
1054-
<<interface>> WithHttpClientInterface
1055-
<<interface>> HttpClientInterface
1056-
<<interface>> WithAuthenticationInterface
1057-
<<interface>> AuthenticationInterface
1075+
<<interface>> HttpTransporterInterface
1076+
<<interface>> WithHttpTransporterInterface
1077+
<<interface>> RequestAuthenticationInterface
1078+
<<interface>> WithRequestAuthenticationInterface
10581079
<<Enumeration>> CapabilityEnum
10591080
<<Enumeration>> OptionEnum
10601081
<<Enumeration>> ProviderTypeEnum

0 commit comments

Comments
 (0)