File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace WordPress \AiClient \Providers \Contracts ;
6+
7+ use InvalidArgumentException ;
8+ use WordPress \AiClient \Operations \DTO \GenerativeAiOperation ;
9+
10+ /**
11+ * Interface for handling provider-level operations.
12+ *
13+ * Provides methods to retrieve and manage long-running operations
14+ * across all models within a provider. Operations are tracked at the
15+ * provider level rather than per-model.
16+ *
17+ * @since n.e.x.t
18+ */
19+ interface ProviderOperationsHandlerInterface
20+ {
21+ /**
22+ * Gets an operation by ID.
23+ *
24+ * @since n.e.x.t
25+ *
26+ * @param string $operationId Operation identifier.
27+ * @return GenerativeAiOperation The operation.
28+ * @throws InvalidArgumentException If operation not found.
29+ */
30+ public function getOperation (string $ operationId ): GenerativeAiOperation ;
31+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace WordPress \AiClient \Providers \Contracts ;
6+
7+ /**
8+ * Interface for providers that support operations handlers.
9+ *
10+ * Providers implementing this interface can return an operations handler
11+ * for managing long-running operations across all their models.
12+ *
13+ * @since n.e.x.t
14+ */
15+ interface ProviderWithOperationsHandlerInterface
16+ {
17+ /**
18+ * Gets the operations handler for this provider.
19+ *
20+ * @since n.e.x.t
21+ *
22+ * @return ProviderOperationsHandlerInterface The operations handler.
23+ */
24+ public static function operationsHandler (): ProviderOperationsHandlerInterface ;
25+ }
You can’t perform that action at this time.
0 commit comments