Skip to content

Commit 1c603de

Browse files
asofioCopilot
andcommitted
Strip TTS, Wikipedia RAG, activity-page agents, and OTEL for workshop starter
This rebuilds main as the workshop-starter version of the app: same architecture, infra, art-style picker, and docs as all-features, but with the four 'guide-able' features removed so workshop attendees can build them back in following the docs in docs/04..07. Removed: - TTS: backend/app/tts.py, /api/tts route, AZURE_SPEECH_* settings, azure-cognitiveservices-speech dep, frontend listen/play buttons. - Wikipedia RAG: backend/app/wikipedia.py, wikipedia_topic / wikipedia_mode StoryRequest fields, orchestrator integration, prompt block, and frontend Wikipedia mode UI. - Activity-page agents: look_and_find, character_glossary, approval_gateway, final_assembly executors and the bonus fan-out branch in workflow.py; activity-page models, prompts, frontend pages, ProgressTracker rows, and demo-story event entries. - OTEL observability: backend/app/telemetry.py, telemetry import in main.py, opentelemetry-* deps, OTEL spans/record_llm_usage calls in agents, and OTEL/ENABLE_INSTRUMENTATION settings. Workflow now reverts to the core sequential chain: Orchestrator -> StoryArchitect -> ArtDirector -> [StoryReviewer?] -> Decision Decision yields the StoryResponse directly to the workflow output (no FinalAssembly downstream). Speech-related Bicep params kept as optional in infra/ so users following the TTS guide can 'azd env set AZURE_SPEECH_RESOURCE_ID …' + 'azd provision' without re-editing Bicep. Demo stories: stripped look_and_find / character_glossary keys from each story.json and removed bonus-agent + wikipedia events from the matching events.json so they replay cleanly with the new tracker. Also: ignore backend/demo_stories/_drafts/ (per-session draft images created by the storage backend at runtime, only promoted on save). Verified: - python -m compileall -q backend/app: clean - 'from app.main import app; build_story_workflow(StoryRequest())': OK - frontend npm run lint: 131 errors (down from 167 baseline) - frontend npm run build: clean - az bicep build infra/main.bicep: clean - end-to-end SSE smoke test (uvicorn + curl): event: complete fires; final story has only the new StoryResponse keys (no look_and_find, no character_glossary); only the 5 expected executors emit progress Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2a25b78 commit 1c603de

33 files changed

Lines changed: 228 additions & 2519 deletions

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ env/
2222
# Per-developer azd env config (only the .example.sh template is committed)
2323
infra/scripts/azd-env.local.sh
2424

25+
# Per-session draft images created by the storage backend at runtime.
26+
# Drafts are promoted into a permanent demo-story folder when the user clicks
27+
# "Save Story"; otherwise they remain here as ephemeral local artifacts.
28+
backend/demo_stories/_drafts/
29+
2530
# Node
2631
node_modules/
2732
frontend/dist/

backend/.env.example

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,3 @@ FOUNDRY_IMAGE_MODEL_DEPLOYMENT_NAME=gpt-image-1.5
1919
# CORS — URL of the React dev server. Change if you run frontend on a different port.
2020
CORS_ORIGIN=http://localhost:5173
2121

22-
# Azure Speech Service (Text-to-Speech)
23-
# Region where your Speech resource is deployed (e.g. eastus, westus2)
24-
# Authentication uses DefaultAzureCredential — ensure your identity has
25-
# the "Cognitive Services Speech User" role on the Speech resource.
26-
AZURE_SPEECH_REGION=[REGION]
27-
AZURE_SPEECH_ENDPOINT=https://[REGION].tts.speech.microsoft.com
28-
29-
# Full ARM resource ID of your Speech resource (required for AAD token auth)
30-
# Format: /subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.CognitiveServices/accounts/<name>
31-
AZURE_SPEECH_RESOURCE_ID=/subscriptions/[SUBSCRIPTION_ID]/resourceGroups/[RESOURCE_GROUP]/providers/Microsoft.CognitiveServices/accounts/[ACCOUNT_NAME]
32-
33-
# ── Agent Framework Observability ──────────────────────────────────────────────
34-
# Activates Agent Framework's built-in instrumentation (spans for agent
35-
# invocations, LLM chat calls, and tool executions).
36-
ENABLE_INSTRUMENTATION=true
37-
38-
# Includes prompts, completions, function arguments and results in span
39-
# attributes. WARNING: only enable in dev/test — may expose PII in traces.
40-
ENABLE_SENSITIVE_DATA=true
41-
42-
# ── Standard OpenTelemetry ─────────────────────────────────────────────────────
43-
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
44-
OTEL_SERVICE_NAME=children-story-studio

backend/app/agents/approval_gateway.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

backend/app/agents/character_glossary.py

Lines changed: 0 additions & 123 deletions
This file was deleted.

backend/app/agents/decision.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
"""
2-
DecisionExecutor — Routing node in the workflow.
2+
DecisionExecutor — Routing & terminal node in the workflow.
33
44
Receives the ReviewResult and decides:
5-
- If approved OR max revision cycles reached → assemble StoryResponse and send_message
6-
downstream to FinalAssemblyExecutor (or fan-out to bonus agents)
7-
- If rejected AND revision budget remains → send RevisionSignal back to OrchestratorExecutor
8-
9-
NOTE: This node no longer calls ctx.yield_output() directly. The terminal yield_output
10-
call has moved to FinalAssemblyExecutor, which is always the last node in the graph.
5+
- If approved OR max revision cycles reached → assemble StoryResponse and
6+
yield_output to end the workflow
7+
- If rejected AND revision budget remains → send RevisionSignal back to
8+
OrchestratorExecutor (full regen) or ImageRevisionSignal back to
9+
ArtDirectorExecutor (selective image regen)
1110
"""
1211

1312
import logging
1413

1514
from agent_framework import Executor, WorkflowContext, handler
1615

17-
from ..config import settings
1816
from ..events import ProgressDetailEvent
1917
from ..models import ReviewResult, StoryDraft, StoryResponse
2018
from ..signals import ImageRevisionSignal, RevisionSignal
@@ -26,7 +24,7 @@
2624

2725
class DecisionExecutor(Executor):
2826
"""
29-
Routes the workflow: approve & emit final story, or loop back for revision.
27+
Routes the workflow: approve & yield final story, or loop back for revision.
3028
"""
3129

3230
def __init__(self) -> None:
@@ -75,10 +73,7 @@ async def handle_review(
7573
)
7674

7775
story_response = await self._assemble_story(review, revision_count, ctx)
78-
# Persist the approved StoryResponse so FinalAssemblyExecutor can always
79-
# read it from shared state, regardless of which bonus agents executed.
80-
ctx.set_state("approved_story", story_response.model_dump_json())
81-
await ctx.send_message(story_response)
76+
await ctx.yield_output(story_response)
8277

8378
elif (
8479
review.revision_scope == "images_only"
@@ -160,3 +155,4 @@ async def _assemble_story(
160155
review_notes=issue_summary if issue_summary else "Story approved with no issues.",
161156
revision_rounds=revision_rounds,
162157
)
158+

backend/app/agents/final_assembly.py

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)