Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
MengqinShen
approved these changes
Feb 7, 2026
366a6fa to
01647ae
Compare
0e45388 to
0d92fbf
Compare
32c4609 to
d891f52
Compare
3a28a20 to
f9632d6
Compare
059de99 to
a204107
Compare
a68e0d1 to
66509f9
Compare
d0cab85 to
410d293
Compare
…vider samples Expand samples/shared/ with common Pydantic models (SayHiInput, SystemPromptInput, MultiTurnInput, CodeInput, StreamInput, CharacterInput, StreamingToolInput, ImageDescribeInput, ConfigInput, ReasoningInput) and flow logic functions (system_prompt_logic, multi_turn_chat_logic, generate_code_logic, describe_image_logic, streaming_tool_flow_logic, reasoning_logic). Slim down anthropic, deepseek, huggingface, and mistral provider samples to import from shared and delegate to logic functions. Slim down amazon-bedrock, cloudflare-workers-ai, microsoft-foundry, xai, google-genai, google-genai-vertexai, compat-oai, and ollama provider samples to import common types, tools, and flow logic from samples/shared/. Provider-specific features remain inline.
410d293 to
113b234
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Standardizes sample directory naming with a consistent taxonomy, extracts shared
flow logic and types into a common
shared/module, adds new framework featuredemos, and closes all feature coverage gaps in provider samples. Every sample now
follows a clear
provider-*,framework-*, orweb-*prefix convention.Rationale
The samples directory had inconsistent naming (e.g.,
menu,flask-hello,ollama-hello,short-n-long) making it hard to discover what a sampledemonstrates. Provider samples also had significant code duplication — the same
flow patterns (greeting, streaming, tools, vision, etc.) were reimplemented in
each sample. This PR:
provider-*— model provider and plugin-specific samplesframework-*— Genkit framework feature demos (context, tools, RAG, etc.)web-*— web framework integration samples (Flask, ASGI, multi-server)samples/shared/so provider samplesdelegate to common implementations, reducing boilerplate
setup_sample()utility for one-call Rich traceback + structlog setupChanges
Sample renames (34 directories):
amazon-bedrock-helloprovider-amazon-bedrock-helloanthropic-helloprovider-anthropic-hellocloudflare-workers-ai-helloprovider-cloudflare-workers-ai-hellocompat-oai-helloprovider-compat-oai-hellodeepseek-helloprovider-deepseek-hellofirestore-retreiverprovider-firestore-retriever(typo fix!)google-genai-code-executionprovider-google-genai-code-executiongoogle-genai-context-cachingprovider-google-genai-context-cachinggoogle-genai-helloprovider-google-genai-hellogoogle-genai-vertexai-helloprovider-google-genai-vertexai-hellogoogle-genai-image/media-models-demoprovider-google-genai-media-models-demogoogle-genai-vertexai-imageprovider-google-genai-vertexai-imagehuggingface-helloprovider-huggingface-hellomicrosoft-foundry-helloprovider-microsoft-foundry-hellomistral-helloprovider-mistral-hellomodel-gardenprovider-vertex-ai-model-gardenobservability-helloprovider-observability-helloollama-helloprovider-ollama-hellovertex-ai-vector-search-bigqueryprovider-vertex-ai-vector-search-bigqueryvertex-ai-vector-search-firestoreprovider-vertex-ai-vector-search-firestorevertexai-rerank-evalprovider-vertex-ai-rerank-evalxai-helloprovider-xai-helloevaluator-demoframework-evaluator-demoformat-demoframework-format-demomenuframework-restaurant-demoprompt-demoframework-prompt-demorealtime-tracing-demoframework-realtime-tracing-demotool-interruptsframework-tool-interruptsflask-helloweb-flask-hellomulti-serverweb-multi-servershort-n-longweb-short-n-longNew samples:
framework-context-demoframework-dynamic-tools-demoframework-middleware-demoDeleted samples:
ollama-simple-embedprovider-ollama-helloShared module consolidation (
samples/shared/):shared/types.py— centralized Pydantic input/output models used across all provider samples (GreetingInput, StreamInput, CharacterInput, CodeInput, WeatherInput, ImageDescribeInput, ReasoningInput, etc.)shared/flows.py— reusable flow logic functions (generate_greeting_logic, generate_streaming_story_logic, describe_image_logic, solve_reasoning_problem_logic, etc.)shared/logging.py(new) —setup_sample()utility that configures Rich tracebacks + colored structlog/stdlib logging in one callshared/__init__.py— updated re-exports for all new types and functionsProvider sample enhancements:
provider-ollama-hello: added Moondream v2 model for object detection (detect_objectsflow with bounding boxes), explicit model parameters for tool-calling flowsOther changes:
pyproject.tomlpackage names updated to match new directory namessample_parity_roadmap.mdadded, oldsample_parity_analysis.mdremoveduv.lockregeneratedTesting
bin/lintpasses with 0 errorspyproject.tomlnames match directory names (consistency check passes)