a2ui-project / a2ui-project/a2ui
Update Express compiler & decompiler to support optional displayName in Event action helper
- Lingua principale
- TypeScript
- Stelle
- 16.4k
- Fork
- 1.3k
- Merge medio
- 3g 15h
- PR unite (30g)
- 134
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia leggendo la modifica alla specifica in PR #2228 per comprendere il nuovo campo displayName. Esamina quindi i file del compilatore e del decompilatore Python indicati, insieme agli equivalenti in Kotlin. L’implementazione di riferimento sul branch 'backup-action-displayname-full' mostra le modifiche complete. Aggiungi la logica di estrazione e inclusione del campo, aggiorna il generatore di prompt e scrivi unit test per entrambi i linguaggi. Infine, aggiorna il documento della specifica express.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- kotlin, python, typescript
- Ambito
- backend-api-design, documentation
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 65/100