Lee-W commented on code in PR #75369:
URL: https://github.com/apache/airflow/pull/75369#discussion_r4519716070


##########
providers/common/ai/src/airflow/providers/common/ai/hooks/pydantic_ai.py:
##########
@@ -562,6 +586,92 @@ def _provider_factory(pname: str) -> Any:
 
         return infer_model(model_name)
 
+    def _build_missing_model_error(self) -> ValueError:
+        return ValueError(
+            f"No model specified for connection '{self.llm_conn_id}'. Set 
model_id on the "
+            "hook or the Model field on the connection."
+        )
+
+    def _resolve_readiness_backend(self, model_name: str) -> 
ModelReadinessBackend:
+        """Build the built-in readiness backend for *model_name*, which only 
exists for Ollama."""
+        prefix, _, ollama_model = model_name.partition(":")
+        if prefix != "ollama":
+            raise NotImplementedError(
+                f"ensure_model_ready has no built-in readiness backend for 
'{model_name}' on "
+                f"connection '{self.llm_conn_id}'; only Ollama is built in. "
+                "Pass backend= an object with is_ready() and load()."
+            )
+        conn, _ = self._get_conn_and_extra()
+        if not conn.host:

Review Comment:
   `OllamaBackend` now uses the connection host, then `OLLAMA_BASE_URL`, and 
raises `ValueError` only when both are empty — the same order `OllamaProvider` 
uses.



-- 
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