uranusjr commented on code in PR #75369:
URL: https://github.com/apache/airflow/pull/75369#discussion_r4463179660


##########
providers/common/ai/src/airflow/providers/common/ai/hooks/pydantic_ai.py:
##########
@@ -45,6 +49,23 @@
 P = ParamSpec("P")
 R = TypeVar("R")
 
+
+class ModelReadinessBackend(Protocol):
+    """
+    Server-specific half of :meth:`PydanticAIHook.ensure_model_ready`.
+
+    Any object with this method works; it does not need to subclass this class.
+
+    ``load`` returns once the model is available, waiting at most *timeout* 
seconds.
+
+    Raise ``TimeoutError`` when the call exceeds *timeout*. Every exception 
(``TimeoutError``,
+    ``httpx2.TransportError``, ``httpx2.HTTPStatusError`` or any other) is 
raised out of
+    ``ensure_model_ready`` as is, and nothing is retried.

Review Comment:
   Instead of repeating the documentation, this can use `:ref:` (plus adding 
the anchors in the documentation)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to