API reference¶
Generated docstrings for the small set of classes that carry the demo’s behavior. The rest of the codebase — CLI commands, settings dataclasses, plugin wiring, IoC providers — is intentionally out of scope; their shapes are stable and reading the source is faster than reading generated docs.
ADK runner¶
The per-request chat runner that ties the Litestar chat controller to Flash-Lite intent routing, grounded row-rendered routes, Google ADK 2.0 fallbacks, and closure-bound tools.
- class app.domain.chat.services.adk.ADKRunner[source]¶
Bases:
objectPer-request ADK 2.0 workflow with closure-bound tools.
- __init__(session_service, classifier, persona_manager)[source]¶
- static ensure_configured()[source]¶
Raise AIServiceUnconfigured if Vertex AI credentials are missing.
- async get_history(user_id, session_id)[source]¶
Return displayable chat history for the current ADK session.
- async get_history_or_empty(user_id, session_id)[source]¶
Return displayable chat history, or an empty list if loading fails.
- async clear_session(user_id, session_id)[source]¶
Delete the current ADK session and its event history.
-
async stream_request(query, user_id, session_id, persona, tools_service, location_context=
None)[source]¶ Stream a chat turn as ADK produces partial events.
- Yields:¶
Delta events followed by one final event with the complete reply payload.
- Raises:¶
AIServiceUnconfigured – If configured credentials are missing or invalid.
ClientError – If the Gemini client fails for a non-credential reason.
ValueError – If ADK raises a non-credential validation error.
- Parameters:¶
- Return type:¶
AsyncIterator[dict[str, Any]]
Services¶
OracleAsyncService subclasses that own the named-SQL queries and result
mapping for products, the embedding/response caches, structured Vertex AI
selection calls, and the per-message metrics surfaced on /explore.
- class app.domain.products.services.services.ProductService[source]¶
Bases:
OracleAsyncServiceHandles database operations for products using SQLSpec patterns.
-
async get_products_for_embedding(force=
False)[source]¶ Return (products_to_embed, total_count). force=True returns every product.
- async update_embedding(product_id, embedding)[source]¶
-
async get_products_for_embedding(force=
- class app.domain.system.services.services.CacheService[source]¶
Bases:
OracleAsyncServiceHandles database operations for response and embedding cache.
-
async set_cached_response(cache_key, response_data, ttl_minutes=
60)[source]¶
-
async set_cached_response(cache_key, response_data, ttl_minutes=
- class app.domain.system.services.services.MetricsService[source]¶
Bases:
OracleAsyncServiceHandles performance metrics and search logging.
Schemas¶
msgspec.Struct types used for request/response bodies, named-SQL row
mapping, and tool payloads.
Chat domain schemas package.
- class app.domain.chat.schemas.ChatMessage[source]¶
Bases:
CamelizedBaseStructIndividual chat message.
Product domain schemas package.
- class app.domain.products.schemas.ApexInventoryList[source]¶
Bases:
CamelizedBaseStructInventory or availability row collection.
- items : list[ProductAvailability]¶
- class app.domain.products.schemas.ApexInventorySummaryList[source]¶
Bases:
CamelizedBaseStructInventory summary collection.
- items : list[ApexInventorySummaryRow]¶
- class app.domain.products.schemas.ApexInventorySummaryRow[source]¶
Bases:
CamelizedBaseStructInventory aggregate counts for a single store.
- class app.domain.products.schemas.ApexOpenAPIStatus[source]¶
Bases:
CamelizedBaseStructCatalog metadata for APEX display.
- class app.domain.products.schemas.ApexProduct[source]¶
Bases:
CamelizedBaseStructProduct catalog row safe for APEX REST Source Catalogs.
- class app.domain.products.schemas.ApexProductList[source]¶
Bases:
CamelizedBaseStructPaginated product rows for APEX catalog consumption.
- items : list[ApexProduct]¶
- class app.domain.products.schemas.ApexRecommendation[source]¶
Bases:
CamelizedBaseStructGrounded recommendation row returned to APEX.
- class app.domain.products.schemas.ApexRecommendationRequest[source]¶
Bases:
CamelizedBaseStructRecommendation request body accepted by APEX REST clients.
- class app.domain.products.schemas.ApexRecommendationResponse[source]¶
Bases:
CamelizedBaseStructRecommendation response with vector timings when available.
- items : list[ApexRecommendation]¶
- class app.domain.products.schemas.ApexStoreList[source]¶
Bases:
CamelizedBaseStructSeeded store rows safe for APEX display.
- class app.domain.products.schemas.ApexVectorReadiness[source]¶
Bases:
CamelizedBaseStructOracle vector data readiness counts.
- class app.domain.products.schemas.ApexVectorStatus[source]¶
Bases:
CamelizedBaseStructEmbedding provider and Oracle vector readiness status.
- class app.domain.products.schemas.ExplainPlan[source]¶
Bases:
CamelizedBaseStructOracle EXPLAIN PLAN output for the vector-search SQL (Panel 2).
- plan_rows : list[ExplainPlanRow]¶
- class app.domain.products.schemas.ExplainPlanRow[source]¶
Bases:
CamelizedBaseStructA structured operation row parsed from Oracle
DBMS_XPLANtext.
- class app.domain.products.schemas.Product[source]¶
Bases:
CamelizedBaseStructProduct entity from database.
- class app.domain.products.schemas.ProductAvailability[source]¶
Bases:
StoreProductInventoryProduct availability row with store and product display fields.
- class app.domain.products.schemas.ProductMatch[source]¶
Bases:
CamelizedBaseStructA product row returned by vector similarity search.
Slim projection of product (no embedding, no metadata) plus the similarity_score derived in SQL via 1 - VECTOR_DISTANCE(…).
- class app.domain.products.schemas.Store[source]¶
Bases:
CamelizedBaseStructStore location entity from database.
- class app.domain.products.schemas.StoreDistance[source]¶
Bases:
StoreStore row plus local coordinate ranking score.
- class app.domain.products.schemas.StoreHours[source]¶
Bases:
CamelizedBaseStructStore hours response contract.
- class app.domain.products.schemas.StoreProductInventory[source]¶
Bases:
CamelizedBaseStructStore-product inventory row.
- class app.domain.products.schemas.VectorDemo[source]¶
Bases:
CamelizedBaseStructFull
POST /api/vector-demopayload for SPA / JSON consumers.- results : list[VectorDemoMatch]¶
- class app.domain.products.schemas.VectorDemoMatch[source]¶
Bases:
CamelizedBaseStructA vector-search hit shaped for the explore-page Panel 1 partial.
- class app.domain.products.schemas.VectorQuery[source]¶
Bases:
CamelizedBaseStructA user-supplied vector-search query string.
System domain schemas package.
- class app.domain.system.schemas.CacheStats[source]¶
Bases:
CamelizedBaseStructEmbedding-cache hit/usage rollup with derived hit rate.
- class app.domain.system.schemas.CacheStatsRow[source]¶
Bases:
CamelizedBaseStructSingle-row projection from
get-cache-stats.
- class app.domain.system.schemas.EmbeddingCache[source]¶
Bases:
CamelizedBaseStructEmbedding cache entry.
- class app.domain.system.schemas.MetricCard[source]¶
Bases:
CamelizedBaseStructSingle card on the metrics summary panel.
- class app.domain.system.schemas.MetricsBreakdown[source]¶
Bases:
CamelizedBaseStructLabels and values for the system breakdown chart.
- class app.domain.system.schemas.MetricsBreakdownRow[source]¶
Bases:
CamelizedBaseStructAggregate component timing row projected from
search_metric.
- class app.domain.system.schemas.MetricsCharts[source]¶
Bases:
CamelizedBaseStructComplete Explore dashboard chart payload.
- time_series : MetricsTimeSeries¶
- scatter : list[MetricsScatterPoint]¶
- breakdown : MetricsBreakdown¶
- class app.domain.system.schemas.MetricsScatterPoint[source]¶
Bases:
CamelizedBaseStructSingle vector-search point for similarity-vs-latency charts.
- class app.domain.system.schemas.MetricsSummary[source]¶
Bases:
CamelizedBaseStructCard list rendered client-side in the Explore dashboard.
- cards : list[MetricCard]¶
- class app.domain.system.schemas.MetricsTimeSeries[source]¶
Bases:
CamelizedBaseStructLatency series payload consumed by ApexCharts.
- series : MetricsTimeSeriesPoints¶
- class app.domain.system.schemas.MetricsTimeSeriesPoints[source]¶
Bases:
CamelizedBaseStructPer-stage latency series for the latency chart.
- class app.domain.system.schemas.MetricsTimeSeriesRow[source]¶
Bases:
CamelizedBaseStructSingle per-minute bucket projected from
metrics-time-series.
- class app.domain.system.schemas.PerformanceStats[source]¶
Bases:
CamelizedBaseStructAggregate latency and volume across a window of
search_metricrows.
- class app.domain.system.schemas.ResponseCache[source]¶
Bases:
CamelizedBaseStructResponse cache entry.