a2ui-project / a2ui-project/a2ui

Update Express compiler & decompiler to support optional displayName in Event action helper

Offen
#2,230 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
P2
Vorherrschende Sprache
TypeScript
Sterne
16.4k
Forks
1.3k
Ø Merge
3 T. 15 Std.
Gemergte PRs (30 T.)
134

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Lies zunächst die Spezifikationsänderung in PR #2228, um das neue Feld displayName zu verstehen. Untersuche anschließend die aufgeführten Python-Compiler- und -Decompiler-Dateien sowie die entsprechenden Kotlin-Dateien. Die Referenzimplementierung auf dem Branch 'backup-action-displayname-full' zeigt die vollständigen Änderungen. Füge die Logik zum Extrahieren und Einbeziehen des Feldes hinzu, aktualisiere den Prompt-Generator und schreibe Unit-Tests für beide Sprachen. Aktualisiere schließlich das express-Spezifikationsdokument.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
kotlin, python, typescript
Bereich
backend-api-design, documentation
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
65/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.