refactor(server): shared LLM classification module for catalyst and polarity #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/shared-llm-classifier"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Collapses the copy-pasted provider stacks in
catalyst/andpolarity/(client factories, structural*Liketypes, provider-switch factories,as anycasts) into one sharedsrc/llm/module owning the generic "classify market text into one of N allowed values, never throw, degrade to default" mechanics. Catalyst and polarity are now thin domain configs (~30 lines each, down from ~110): an enum + prompt + default, plus the unchanged Composite orchestration. The only external call site (index.ts) is untouched.as anycasts removed — the structural types now accept the real SDK clients directly.z.enumviazodOutputFormat(the stronger pattern polarity already used). The OpenAI path deliberately keeps JSON.parse + whitelist:baseUrlimplies OpenAI-compatible gateways that may not supportjson_schemaresponse format; the whitelist gives equivalent safety.Tests: 56 files / 311 passing — all pre-existing, no behavior changes; typecheck clean.
a0f20c3454to99df00ba17