generate GeneratedWorkflowParameters (#3264)

This commit is contained in:
Shuchang Zheng
2025-08-21 15:42:34 -07:00
committed by GitHub
parent 988416829f
commit 2a62dc08aa
7 changed files with 504 additions and 64 deletions

View File

@@ -0,0 +1,47 @@
You are an expert at analyzing user interface automation actions and generating meaningful field names for data structures.
Given a list of input_text actions with their intentions and text values, generate appropriate field names for a Pydantic BaseModel class called "GeneratedWorkflowParameters".
## Rules:
1. Field names should be valid Python identifiers (snake_case, no spaces, no special characters except underscore)
2. Field names should be descriptive and based on the intention of the action
3. If multiple actions input the same text value, they should map to the same field name
4. Field names should be concise but clear about what data they represent
5. Avoid generic names like "field1", "input1" - use meaningful names based on the intention
## Input Actions:
{% for action in input_actions %}
Action {{ loop.index }}:
- Text: "{{ action.text }}"
- Intention: "{{ action.intention }}"
{% endfor %}
## Expected Output:
Return a JSON object with the following structure:
```json
{
"field_mappings": {
"action_index_1": "field_name_1",
"action_index_2": "field_name_2",
...
},
"schema_fields": {
"field_name_1": {
"type": "str",
"description": "Description of what this field represents"
},
"field_name_2": {
"type": "str",
"description": "Description of what this field represents"
},
...
}
}
```
Where:
- `field_mappings` maps each action index (1-based) to its corresponding field name
- `schema_fields` defines each unique field with its type and description
- Actions with the same text value should map to the same field name
Generate the field names now: