feat(workflow-utils): add createLlmAdapter AgentFn factory #278
Reference in New Issue
Block a user
Delete Branch "refactor/277-llm-adapter-four-tuple"
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?
What
Add
createLlmAdapter(provider): AgentFn— a single-turn LLM chat adapter that conforms to theAgentFninterface, enabling pure-LLM roles to use the standardcreateRole(adapter, prompt, schema, extract)four-tuple pattern.Why
questionerandanswererroles in knowledge-extraction were hand-assembled instead of usingcreateRole. This adapter fills the gap — roles that don't need an agent (cursor/hermes) can use a simple LLM adapter instead.Changes
create-llm-adapter.ts— new file:createLlmAdapter(provider)returnsAgentFnusingchatCompletionTextindex.ts— exportcreateLlmAdaptercreate-llm-adapter.test.ts— unit testsWorkspace-side changes (questioner/answerer refactor to use
createRole) committed separately tonerve-workspace.Ref
Fixes #277