diff --git a/docs/migrating-from-0.12.md b/docs/migrating-from-0.12.md index 4b00e93f6..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 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:** @@ -566,8 +566,13 @@ 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': ... + +try: + await ai.embed(embedder=e, content=doc) +except GenkitError as err: + if err.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..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 60000ms. + 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. diff --git a/packages/genkit-ollama/README.md b/packages/genkit-ollama/README.md index 085dfd9f8..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 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, 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