Repository navigation
docs(py): Genkit 1.0 API review - #6778
huangjeff5 wants to merge 45 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the Genkit 1.0 API Review document for Python, detailing the public API surface, model generation, error recovery, flows, web serving, telemetry, and runtime architecture. The review feedback highlights a recurring issue across multiple code snippets where StreamResponse objects (from ai.generate_stream, deploy_service.stream, and quarterly_report.stream) are directly used as async iterables. Since StreamResponse does not implement __aiter__ or __anext__, these snippets should be updated to iterate over the .stream property instead.
…in 1.0 API review
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- Background models return Operation[ModelResponse]; example builds a ModelResponse and reloads a stored handle. - Explain genkit.exp.Genkit as the experimental subclass. - Mid-turn recovery: pass the Failure value to a handler; clarify that except GenkitError only catches setup errors. - Typed evaluator options (per-row and batch) and embedder options. - Interrupt resume takes a single Part; streaming uses stream.stream. - Drop the streamed-chunk tradeoffs and the ASCII runtime diagram. - Veo 3.1 model id; enum annotations print values.
…lResponse example
…ns Operation[ModelResponse]
…ection thread, and loop_local_client
…ine_prompt, overrides, streaming
| # => Total tokens: 34 | ||
| ``` | ||
|
|
||
| ### Streaming Structured Output: Typed Partials (feedback wanted) |
There was a problem hiding this comment.
Feedback wanted here
…BatchEvaluatorRequest[Cfg]
…vation to 1.0 API review doc
|
Closing as approved by Lahiru; Genkit 1.0 Python API review and implementation migrated to genkit-ai/genkit-python. |
Adds
py/engdocs/genkit_1_0_api_review.md: the Python surface we plan to ship as 1.0, mostly as snippets, for API review.It describes the state after the open API PRs land, not
maintoday: #6697, #6698, #6699, #6709, #6757, #6764–#6770, #6775, #6777, #6314, #6655.What's in it
tool.stream()), interrupts, typed Gemini refs and flat config, background models.response.messages.serve_flow,handle_genkit_request,to_sse,genkit.webhelpers), per-tenant keys throughcontext.secrets,PublicErrorvs internal error redaction.genkit_otel, embedders, evaluators, middleware (A2UISurfaces), and the runtime architecture.