Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions agent_sdks/python/a2ui_agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Unreleased

- Invoke ANTLR from the grammar's directory when regenerating the Express parser, so generated file headers no longer embed the absolute path of the machine that built them.
- Stop rewriting the non-package fallback import in the generated Express visitor to a relative import, which pointed at a module name the rename step had already replaced. A from-source build now leaves the working tree clean.

## 0.5.0

- Rename inference format `Transport` / `transport` terminology to `Direct JSON` / `direct_json` (`DirectJsonFormat`, `DirectJsonParser`, `DirectJsonStreamParser`). Deprecate `a2ui.inference_formats.transport` module alias.
Expand Down
4 changes: 4 additions & 0 deletions agent_sdks/python/a2ui_agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ protocol.

## Building the SDK

Building from source regenerates the Express parser from
`specification/inference_formats/express/Express.g4`. That step runs ANTLR, which
requires a Java runtime (JRE 11 or newer) on the `PATH`.

To build the SDK, run the following command from the `agent_sdks/python/a2ui_agent`
directory:

Expand Down
8 changes: 4 additions & 4 deletions agent_sdks/python/a2ui_agent/pack_specs_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ def initialize(self, version, build_data):
"-visitor",
"-no-listener",
"-o",
"generated",
g4_path,
os.path.abspath(generated_dir),
os.path.basename(g4_path),
]
env = os.environ.copy()
env["ANTLR4_TOOLS_ANTLR_VERSION"] = "4.13.2"

res = subprocess.run(
cmd,
cwd=express_dir,
cwd=os.path.dirname(g4_path),
env=env,
capture_output=True,
text=True,
Expand Down Expand Up @@ -190,7 +190,7 @@ def initialize(self, version, build_data):
"from .ExpressParser import", "from .express_parser import"
)
content = content.replace(
"from ExpressParser import", "from .express_parser import"
"from ExpressParser import", "from express_parser import"
)
with open(visitor_path, "w", encoding="utf-8") as f:
f.write(content)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated from /usr/local/google/home/gspencer/code/a2ui/kotlin_express/specification/inference_formats/express/Express.g4 by ANTLR 4.13.2
# Generated from Express.g4 by ANTLR 4.13.2
from antlr4 import *
from io import StringIO
import sys
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated from /usr/local/google/home/gspencer/code/a2ui/kotlin_express/specification/inference_formats/express/Express.g4 by ANTLR 4.13.2
# Generated from Express.g4 by ANTLR 4.13.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Generated from /usr/local/google/home/gspencer/code/a2ui/kotlin_express/specification/inference_formats/express/Express.g4 by ANTLR 4.13.2
# Generated from Express.g4 by ANTLR 4.13.2
from antlr4 import *
if "." in __name__:
from .express_parser import ExpressParser
else:
from express_parser import ExpressParser


# This class defines a complete generic visitor for a parse tree produced by ExpressParser.

class ExpressVisitor(ParseTreeVisitor):
Expand Down
Loading