OxyJen v0.4 - Typed, compile time safe LLM output and deterministic Tools API for safe AI pipelines
What’s new in v0.4
Typed LLM outputs
- You can define the expected type and get a real object back with
SchemaNode<T> - No manual JSON parsing
- No regex
- No unsafe casting
Easy JSON Schema from Java classes with SchemaGenerator.fromClass(User.class)**
Supports:
- Records / POJOs
- Nested objects
- Lists / Maps / Enums
- Optional
- Validation annotations
So the model output must match a real contract.
Built-in JSON runtime
- Parser -> JSON -> Map / List / primitives using
JsonParser.parse(json) - Mapper -> JSON -> Java objects using
JsonMapper.deserialize(json, User.class) - Validator -> JSON -> schema-checked
Strict schema validation
Detects:
- missing fields
- wrong types
- unknown fields (strict mode)
- nested errors
- enum / pattern / size violations
Makes pipelines much safer for production.
SchemaNode
Combines:
- LLM call
- retry loop
- schema enforcement
- validation
- mapping -> typed object
SchemaNode<User> node = SchemaNode.builder(User.class)
.model("gpt-4o-mini")
.maxRetries(3)
.build();Tools API (new runtime)
Added a deterministic tool execution layer:
ToolCall -> ToolExecutor -> Tool -> ToolResult
Features:
- JSON-schema input validation
- strict mode (reject unknown args)
- permission system
- sandbox execution (timeout + path isolation)
- output validation
- fail-safe execution (never throws, always returns result)
Example:
ToolExecutor executor = ToolExecutor.builder()
.addTool(new FileReaderTool(sandbox))
.strictInputValidation(true)
.validateOutput(true)
.build();###Safety layer
ToolPermission -> allow/block tools
ToolSandbox -> filesystem + timeout isolation
ToolValidator -> schema validation
**Graph integration with ToolNode
##Built-in tools
FileReaderTool
- sandboxed file access
- chunking / partial read
- metadata / MIME
- binary-safe mode
HttpTool
- GET / POST / PUT / DELETE / PATCH
- domain allowlist
- timeout + size limits
- full metadata + error info