feat: ReAct ExtractFn with tool-use
- RoleDefinition.extractMode: "single" | "react" - reactExtract: multi-turn LLM with cas_get tool for DAG traversal - Max 10 tool-call rounds, schema validation on final output - create-workflow routes to reactExtract when extractMode is "react" - All existing roles set to "single" (no behavior change) - 162 tests passing Fixes #44
This commit is contained in:
@@ -29,6 +29,7 @@ const greeter: RoleDefinition<Roles["greeter"]> = {
|
||||
extractPrompt: "Extract the greeting string produced for the user.",
|
||||
schema: greeterMetaSchema,
|
||||
extractRefs: null,
|
||||
extractMode: "single",
|
||||
};
|
||||
|
||||
const extract = createExtract({
|
||||
@@ -48,4 +49,5 @@ export const run = createWorkflow<Roles>(
|
||||
agent: async (ctx) => `Hello, ${ctx.start.content}`,
|
||||
},
|
||||
extract,
|
||||
null,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user