a2ui-project / a2ui-project/a2ui
Update Express compiler & decompiler to support optional displayName in Event action helper
- Langage dominant
- TypeScript
- Étoiles
- 16.4k
- Forks
- 1.3k
- Merge moyen
- 3 j 15 h
- PR mergées (30 j)
- 134
Description
Following the specification update in PR #2228 (which added an optional `displayName` field to `Action.event` and `renderer_to_agent` `action` payloads), the Express DSL compiler and decompiler in Python and Kotlin SDKs should be updated to parse, compile, and decompile `displayName` / `display_name`.
### Details of Work Required
1. **Python Express SDK**:
- Update `agent_sdks/python/a2ui_agent/src/a2ui/inference_formats/experimental/express/compiler.py`:
- Extract `displayName` / `display_name` from keyword arguments (`kwargs`) or positional arguments in `Event("name", context, displayName="...")` calls.
- Include `"displayName"` in compiled `"event"` dictionary.
- Update `agent_sdks/python/a2ui_agent/src/a2ui/inference_formats/experimental/express/decompiler.py`:
- Format `displayName` keyword argument when decompiling `"event"` dictionary containing `"displayName"`.
- Update `agent_sdks/python/a2ui_agent/src/a2ui/inference_formats/experimental/express/prompt_generator.py`:
- Document `displayName` in Rule 8 of system prompt generator.
- Add Python unit tests in `test_compiler.py` and `test_parser_decompile.py`.
2. **Kotlin Express SDK**:
- Update `kotlin/agent_sdk_legacy/src/main/kotlin/com/google/a2ui/inference_formats/experimental/express/ExpressCompiler.kt`:
- Extract `displayName` / `display_name` from `fnKwargs` or positional args in `Event(...)`.
- Include `"displayName"` in compiled `"event"` JSON object.
- Update `kotlin/agent_sdk_legacy/src/main/kotlin/com/google/a2ui/inference_formats/experimental/express/ExpressDecompiler.kt`:
- Format `displayName` when decompiling `"event"`.
- Update `kotlin/agent_sdk_legacy/src/main/kotlin/com/google/a2ui/inference_formats/experimental/express/ExpressPromptGenerator.kt`:
- Document `displayName` in Rule 8.
- Add Kotlin unit tests in `ExpressCompilerTest.kt` and `ExpressDecompilerTest.kt`.
3. **Documentation**:
- Update `specification/proposals/express/a2ui_express.md` to document the optional `displayName` parameter for `Event`.
### Reference Implementation
A complete, fully verified implementation of these changes was prepared and backed up on branch `backup-action-displayname-full` in repository `jacobsimionato/a2ui`.
Referenced Spec Change PR: https://github.com/a2ui-project/a2ui/pull/2228
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commence par lire la modification de la spécification dans PR #2228 afin de comprendre le nouveau champ displayName. Examine ensuite les fichiers du compilateur et du décompilateur Python indiqués, ainsi que leurs équivalents Kotlin. L’implémentation de référence sur la branche 'backup-action-displayname-full' montre les modifications complètes. Ajoute la logique d’extraction et d’inclusion du champ, mets à jour le générateur de prompts et écris des tests unitaires pour les deux langages. Enfin, mets à jour le document de spécification express.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- kotlin, python, typescript
- Domaine
- backend-api-design, documentation
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 65/100