From 483f7cb7cf6d7530deacd67adc96665dd3547806 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Fri, 6 Nov 2026 11:57:40 -0600 Subject: [PATCH 1/5] docs(py): check res.error for provider failures in the 0.12 migration guide --- docs/migrating-from-0.12.md | 6 +++--- .../src/genkit_google_cloud/_telemetry/_tracing.py | 2 +- packages/genkit-ollama/README.md | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/migrating-from-0.12.md b/docs/migrating-from-0.12.md index 4b00e93f6..ac5392993 100644 --- a/docs/migrating-from-0.12.md +++ b/docs/migrating-from-0.12.md @@ -554,7 +554,7 @@ except GenkitError as e: ## Plugin exception types -Plugin-specific exceptions such as `OllamaConnectionError` are gone. Check the status instead. +Plugin-specific exceptions such as `OllamaConnectionError` are gone. Check the status on `res.error` instead. **Old:** @@ -566,8 +566,8 @@ except GenkitError as e: **New:** ```python -except GenkitError as e: - if e.status == 'UNAVAILABLE': ... +res = await ai.generate(model=m, prompt=p) +if res.error and res.error.status == 'UNAVAILABLE': ... ``` ## Interrupts and except Exception diff --git a/packages/genkit-google-cloud/src/genkit_google_cloud/_telemetry/_tracing.py b/packages/genkit-google-cloud/src/genkit_google_cloud/_telemetry/_tracing.py index 98c741700..4168804bf 100644 --- a/packages/genkit-google-cloud/src/genkit_google_cloud/_telemetry/_tracing.py +++ b/packages/genkit-google-cloud/src/genkit_google_cloud/_telemetry/_tracing.py @@ -126,7 +126,7 @@ def enable_google_cloud_telemetry( ``GenAiInstrumentation`` is still installed. Metrics and logs may still be exported. Defaults to False. metric_export_interval_ms: Metrics export interval in milliseconds. - GCP requires a minimum of 5000ms. Defaults to 60000ms. + GCP requires a minimum of 5000ms. Defaults to 300000ms. metric_export_timeout_ms: Timeout for metrics export in milliseconds. Defaults to the export interval if not specified. diff --git a/packages/genkit-ollama/README.md b/packages/genkit-ollama/README.md index 085dfd9f8..6c70801b7 100644 --- a/packages/genkit-ollama/README.md +++ b/packages/genkit-ollama/README.md @@ -239,10 +239,10 @@ embedders. ### Troubleshooting -If the plugin can't reach the server it raises a `GenkitError` with status -`UNAVAILABLE` and the URL it tried (`DEADLINE_EXCEEDED` if the request timed -out). Start the daemon (`ollama serve`) or set `base_url` to a reachable -host. +If the plugin can't reach the server, `ai.generate` returns the failure on +`res.error` with status `UNAVAILABLE` and the URL it tried +(`DEADLINE_EXCEEDED` if the request timed out). Start the daemon +(`ollama serve`) or set `base_url` to a reachable host. ## Sample From a687e0482bc9235ba63ac791a04a1533bf475d20 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Tue, 10 Nov 2026 00:49:22 -0600 Subject: [PATCH 2/5] docs(ollama): note ai.embed still raises on an unreachable server --- packages/genkit-ollama/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/genkit-ollama/README.md b/packages/genkit-ollama/README.md index 6c70801b7..09962afa0 100644 --- a/packages/genkit-ollama/README.md +++ b/packages/genkit-ollama/README.md @@ -239,10 +239,11 @@ embedders. ### Troubleshooting -If the plugin can't reach the server, `ai.generate` returns the failure on -`res.error` with status `UNAVAILABLE` and the URL it tried -(`DEADLINE_EXCEEDED` if the request timed out). Start the daemon -(`ollama serve`) or set `base_url` to a reachable host. +If the plugin can't reach the server, the failure has status `UNAVAILABLE` +and the URL it tried (`DEADLINE_EXCEEDED` if the request timed out). +`ai.generate` returns it on `res.error`; `ai.embed` raises it as a +`GenkitError`. Start the daemon (`ollama serve`) or set `base_url` to a +reachable host. ## Sample From ac706bb42b6dc3df90c8f54d4e2f5b2b6fad77ff Mon Sep 17 00:00:00 2001 From: huangjeff5 <64040981+huangjeff5@users.noreply.github.com> Date: Tue, 10 Nov 2026 10:44:49 -0600 Subject: [PATCH 3/5] Update docs/migrating-from-0.12.md Co-authored-by: Jacob Cable <32874567+cabljac@users.noreply.github.com> --- docs/migrating-from-0.12.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/migrating-from-0.12.md b/docs/migrating-from-0.12.md index ac5392993..4425cd84a 100644 --- a/docs/migrating-from-0.12.md +++ b/docs/migrating-from-0.12.md @@ -568,6 +568,11 @@ except GenkitError as e: ```python res = await ai.generate(model=m, prompt=p) if res.error and res.error.status == 'UNAVAILABLE': ... + +try: + await ai.embed(embedder=e, content=doc) +except GenkitError as err: + if err.status == 'UNAVAILABLE': ... ``` ## Interrupts and except Exception From 3025a851557d3eeccbdb92140ef8d166038f0305 Mon Sep 17 00:00:00 2001 From: huangjeff5 <64040981+huangjeff5@users.noreply.github.com> Date: Tue, 10 Nov 2026 10:45:55 -0600 Subject: [PATCH 4/5] Update packages/genkit-google-cloud/src/genkit_google_cloud/_telemetry/_tracing.py Co-authored-by: Jacob Cable <32874567+cabljac@users.noreply.github.com> --- .../src/genkit_google_cloud/_telemetry/_tracing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/genkit-google-cloud/src/genkit_google_cloud/_telemetry/_tracing.py b/packages/genkit-google-cloud/src/genkit_google_cloud/_telemetry/_tracing.py index 4168804bf..8ea6dd5e9 100644 --- a/packages/genkit-google-cloud/src/genkit_google_cloud/_telemetry/_tracing.py +++ b/packages/genkit-google-cloud/src/genkit_google_cloud/_telemetry/_tracing.py @@ -126,7 +126,7 @@ def enable_google_cloud_telemetry( ``GenAiInstrumentation`` is still installed. Metrics and logs may still be exported. Defaults to False. metric_export_interval_ms: Metrics export interval in milliseconds. - GCP requires a minimum of 5000ms. Defaults to 300000ms. + GCP requires a minimum of 5000ms. Defaults to 300000ms (5000ms when ``GENKIT_ENV=dev``). metric_export_timeout_ms: Timeout for metrics export in milliseconds. Defaults to the export interval if not specified. From 6ba23fc71ae1e1e4ba0c6fc330e03221b6f3c666 Mon Sep 17 00:00:00 2001 From: huangjeff5 <64040981+huangjeff5@users.noreply.github.com> Date: Tue, 10 Nov 2026 11:33:40 -0600 Subject: [PATCH 5/5] Update docs/migrating-from-0.12.md Co-authored-by: Jacob Cable <32874567+cabljac@users.noreply.github.com> --- docs/migrating-from-0.12.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migrating-from-0.12.md b/docs/migrating-from-0.12.md index 4425cd84a..ca0d99d33 100644 --- a/docs/migrating-from-0.12.md +++ b/docs/migrating-from-0.12.md @@ -554,7 +554,7 @@ except GenkitError as e: ## Plugin exception types -Plugin-specific exceptions such as `OllamaConnectionError` are gone. Check the status on `res.error` instead. +Plugin-specific exceptions such as `OllamaConnectionError` are gone. Check the failure's `status` instead: `ai.generate` returns the failure on `res.error`, and `ai.embed` raises it as a `GenkitError`. **Old:**