feat: extraction expressions math + workflow calculatrice paramétrable
- IntentParser: ajout pattern "expression" pour capturer 5+2, 100*3, etc.
- demo_calculator.json: text "${expression}=" avec default "2+2"
→ l'utilisateur peut dire "calcule 5+2" et le paramètre est injecté
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -139,6 +139,10 @@ class IntentParser:
|
||||
r"de\s+([A-Za-z])\s+à\s+([A-Za-z])",
|
||||
r"(\d+)\s*(?:-|à|to)\s*(\d+)",
|
||||
],
|
||||
"expression": [
|
||||
# Expressions mathématiques : 5+2, 100*3, 12/4, 7-3, 2.5+3.1
|
||||
r"(\d+(?:[.,]\d+)?\s*[+\-*/x×÷]\s*\d+(?:[.,]\d+)?)",
|
||||
],
|
||||
}
|
||||
|
||||
def __init__(
|
||||
|
||||
100
data/training/workflows/demo_calculator.json
Normal file
100
data/training/workflows/demo_calculator.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"workflow_id": "demo_calculator",
|
||||
"name": "Demo - Calculatrice",
|
||||
"description": "Ouvre la calculatrice et effectue un calcul simple",
|
||||
"version": "1.0.0",
|
||||
"created_at": "2024-11-29T10:00:00",
|
||||
"updated_at": "2024-11-29T10:00:00",
|
||||
"learning_state": "OBSERVATION",
|
||||
"execution_count": 0,
|
||||
"entry_nodes": ["start"],
|
||||
"end_nodes": ["end"],
|
||||
"nodes": [
|
||||
{
|
||||
"node_id": "start",
|
||||
"name": "Desktop",
|
||||
"description": "Écran de départ",
|
||||
"template": {
|
||||
"title_pattern": ".*"
|
||||
},
|
||||
"is_entry": true,
|
||||
"is_end": false,
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"node_id": "calc_open",
|
||||
"name": "Calculatrice ouverte",
|
||||
"description": "La calculatrice est visible",
|
||||
"template": {
|
||||
"title_pattern": ".*(calc|gnome-calculator).*"
|
||||
},
|
||||
"is_entry": false,
|
||||
"is_end": false,
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"node_id": "end",
|
||||
"name": "Calcul effectué",
|
||||
"description": "Le calcul est affiché",
|
||||
"template": {
|
||||
"title_pattern": ".*"
|
||||
},
|
||||
"is_entry": false,
|
||||
"is_end": true,
|
||||
"metadata": {}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"edge_id": "open_calc",
|
||||
"source_node": "start",
|
||||
"target_node": "calc_open",
|
||||
"action": {
|
||||
"type": "compound",
|
||||
"target": {
|
||||
"by_role": null,
|
||||
"selection_policy": "first"
|
||||
},
|
||||
"parameters": {
|
||||
"steps": [
|
||||
{"type": "key_press", "key": "super"},
|
||||
{"type": "wait", "duration_ms": 500},
|
||||
{"type": "text_input", "text": "calculator"},
|
||||
{"type": "key_press", "key": "Return"}
|
||||
]
|
||||
}
|
||||
},
|
||||
"constraints": {
|
||||
"timeout_ms": 5000
|
||||
},
|
||||
"confidence_threshold": 0.7
|
||||
},
|
||||
{
|
||||
"edge_id": "do_calc",
|
||||
"source_node": "calc_open",
|
||||
"target_node": "end",
|
||||
"action": {
|
||||
"type": "text_input",
|
||||
"target": {
|
||||
"by_role": "button",
|
||||
"selection_policy": "first"
|
||||
},
|
||||
"parameters": {
|
||||
"text": "${expression}=",
|
||||
"defaults": {
|
||||
"expression": "2+2"
|
||||
}
|
||||
}
|
||||
},
|
||||
"constraints": {
|
||||
"timeout_ms": 3000
|
||||
},
|
||||
"confidence_threshold": 0.8
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"author": "RPA Vision V3",
|
||||
"tags": ["demo", "calculator"],
|
||||
"difficulty": "easy"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user