a2ui-project / a2ui-project/a2ui
Update Express compiler & decompiler to support optional displayName in Event action helper
- Lenguaje dominante
- TypeScript
- Estrellas
- 16.4k
- Forks
- 1.3k
- Merge medio
- 3 d 15 h
- PR fusionados (30 d)
- 134
Descripción
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
Guía de contribución
Línea de trabajo
Empieza leyendo el cambio de especificación en PR #2228 para entender el nuevo campo displayName. Después, examina los archivos del compilador y del decompilador de Python indicados, así como sus equivalentes en Kotlin. La implementación de referencia en la rama 'backup-action-displayname-full' muestra los cambios completos. Añade la lógica de extracción e inclusión del campo, actualiza el generador de prompts y escribe pruebas unitarias para ambos lenguajes. Finalmente, actualiza el documento de especificación de express.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- kotlin, python, typescript
- Área
- backend-api-design, documentation
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bien especificado
- Aptitud para principiantes
- 65/100