Skip to content

Commit 59ba3ff

Browse files
committed
Add codegen-llm: LLM-based Pydantic type generation from River TypeScript servers
TypeScript CLI tool that uses the Codex SDK to generate clean, well-structured Pydantic v2 models from a River TypeScript server's source code. Instead of the current mechanical codegen that produces awful names and duplicated types, this points a Codex agent at the TypeScript source so it can read how types are named and organised, then generates matching Python models. Key features: - Reads TypeScript TypeBox definitions to mirror naming and composition - Generates shared/reusable types (common errors, domain types) - Verifies correctness by comparing generated JSON schemas against the serialised River schema (via a Python verification script) - Iterates on failures: feeds verification errors back to the model - Exposed as a CLI for GitHub Actions integration Usage: codegen-llm generate \ --server-src ./path/to/ts/services \ --schema ./schema.json \ --output ./generated \ --client-name MyClient
1 parent bd88e45 commit 59ba3ff

File tree

11 files changed

+2656
-0
lines changed

11 files changed

+2656
-0
lines changed

codegen-llm/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
*.tsbuildinfo

codegen-llm/bin/codegen-llm.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
import("../dist/cli.js");

0 commit comments

Comments
 (0)