Skip to content

Add configuration for split_by_intent #727

@ericnewcomer

Description

@ericnewcomer

We need to configure both the flow render function and the form for editing classifiers.

Please model the interface after the old React form from here:
https://github.com/nyaruka/floweditor/tree/main/src/components/flow/routers/classify

This should show up in the splits for the node type selector alongside split by ai. You can review how split_by_llm_categorize works in case that is helpful.

The split_by_intent node is a unique in the following ways:

It lets the user optionally configure what to split on. It defaults to a link that says, "Run the [last response] through the classifier..." When clicking on the link they should replace the link with a text input with the current value of @input.text. There is no way to go back, but if the value is @input.text when editing it in the future, it should show the link treatment again. This is similar to how result_name works on wait_for_response and split_by_expression.

Additionally the intents are dropdowns and they are synced from classifiers. Model some mocked responses in the demo json endpoints so we have a sample classifier to work with. Look at the expected responses in the React version and follow that response format exactly since the server side we are working with in the new version is unchanged for this.

The operator choices for the rules list is only has_intent and has_top_intent. The first operand is a dropdown for the intent choices and the second operand is a small input box for a numeric threshold (defaulting to .9 and pre-filling the category when selecting an intent).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions