Default data schema output to recommend snake_case (#SKY-7446) (#4764)
This commit is contained in:
@@ -27,7 +27,7 @@ export const errorMappingExampleValue = {
|
|||||||
export const dataSchemaExampleValue = {
|
export const dataSchemaExampleValue = {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
sample: { type: "string" },
|
sample_field: { type: "string" },
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ BLOCK STRUCTURE REQUIREMENTS:
|
|||||||
1. Each block MUST have: label, block_type, continue_on_failure
|
1. Each block MUST have: label, block_type, continue_on_failure
|
||||||
2. Navigation blocks need: url (can be empty string ""), navigation_goal, engine (set to "skyvern-1.0")
|
2. Navigation blocks need: url (can be empty string ""), navigation_goal, engine (set to "skyvern-1.0")
|
||||||
3. Login blocks need: url, navigation_goal, parameter_keys (empty array if no credentials), engine (set to "skyvern-1.0")
|
3. Login blocks need: url, navigation_goal, parameter_keys (empty array if no credentials), engine (set to "skyvern-1.0")
|
||||||
4. Extraction blocks need: url (can be empty string ""), data_extraction_goal, data_schema, engine (set to "skyvern-1.0")
|
4. Extraction blocks need: url (can be empty string ""), data_extraction_goal, data_schema (use snake_case for all field names, e.g., product_name, order_date), engine (set to "skyvern-1.0")
|
||||||
5. Action blocks need: url (can be empty string ""), navigation_goal, engine (set to "skyvern-1.0")
|
5. Action blocks need: url (can be empty string ""), navigation_goal, engine (set to "skyvern-1.0")
|
||||||
6. Validation blocks need: complete_criterion OR terminate_criterion (at least one must be set), parameter_keys (empty array if none)
|
6. Validation blocks need: complete_criterion OR terminate_criterion (at least one must be set), parameter_keys (empty array if none)
|
||||||
7. For_loop blocks need: loop_blocks, loop_variable_reference
|
7. For_loop blocks need: loop_blocks, loop_variable_reference
|
||||||
|
|||||||
@@ -2,18 +2,20 @@ We are developing an interface for AI agent tasks that use JSON schemas to descr
|
|||||||
|
|
||||||
You are given an input prompt from a user, and some additional context. Your goal is to generate a JSON schema given the user prompt and the context.
|
You are given an input prompt from a user, and some additional context. Your goal is to generate a JSON schema given the user prompt and the context.
|
||||||
|
|
||||||
|
IMPORTANT: All field names in the schema MUST use snake_case naming convention (e.g., "first_name", "total_price", "order_date"). Do not use camelCase, PascalCase, or spaces in field names.
|
||||||
|
|
||||||
If additional context is given, try to use the it for further clues about the data that needs to be extracted. For example, the user might provide some detail about
|
If additional context is given, try to use the it for further clues about the data that needs to be extracted. For example, the user might provide some detail about
|
||||||
product information to be extracted in a "data_extraction_goal" inside the context, but maybe not necessarily pass it in the input prompt. In these cases, you should use the
|
product information to be extracted in a "data_extraction_goal" inside the context, but maybe not necessarily pass it in the input prompt. In these cases, you should use the
|
||||||
context.
|
context.
|
||||||
|
|
||||||
Here is an example:
|
Here is an example:
|
||||||
|
|
||||||
User prompt: Generate a data schema that extracts the title and link for the posts as a list
|
User prompt: Generate a data schema that extracts the title, link, and author name for the posts as a list
|
||||||
Additional context:
|
Additional context:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"url": "https://news.ycombinator.com",
|
"url": "https://news.ycombinator.com",
|
||||||
"data_extraction_goal": "Extract the title and link of the top 5 posts",
|
"data_extraction_goal": "Extract the title, link, and author name of the top 5 posts",
|
||||||
"existing_schema": "null"
|
"existing_schema": "null"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -33,11 +35,16 @@ Suggested Data Schema:
|
|||||||
"link": {
|
"link": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Link to the post"
|
"description": "Link to the post"
|
||||||
|
},
|
||||||
|
"author_name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the post author"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"title",
|
"title",
|
||||||
"link"
|
"link",
|
||||||
|
"author_name"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing comma
|
|||||||
|
|
||||||
Reply in JSON format with the following keys:
|
Reply in JSON format with the following keys:
|
||||||
{
|
{
|
||||||
"schema": JSON, // the schema of the output data to extract. Use JSON Schema specification style.
|
"schema": JSON, // the schema of the output data to extract. Use JSON Schema specification style. All field names MUST use snake_case (e.g., product_name, order_date).
|
||||||
}
|
}
|
||||||
|
|
||||||
The URL of the page you're on right now is `{{ current_url }}`.
|
The URL of the page you're on right now is `{{ current_url }}`.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ Reply in JSON format with the following keys:
|
|||||||
"thoughts": str, // Think step by step. What would the use do to achieve the goal.
|
"thoughts": str, // Think step by step. What would the use do to achieve the goal.
|
||||||
"navigation_goal": str, // What kind things the user needs to do in the web achieve the plan and finally get the data to extract. Include all the data needed to complete the goal here.{% if is_link %} The user already has the link to go to the target page first, in order to start executing the plan. So state the navigation goal from the perspective of already being on the target page. What does the user need to do from there?{% endif %}
|
"navigation_goal": str, // What kind things the user needs to do in the web achieve the plan and finally get the data to extract. Include all the data needed to complete the goal here.{% if is_link %} The user already has the link to go to the target page first, in order to start executing the plan. So state the navigation goal from the perspective of already being on the target page. What does the user need to do from there?{% endif %}
|
||||||
"data_extraction_goal": str, // If the user needs to extract/retrieve data from the site after navigation goal is achieved, define that extraction goal here. null if no data needs to be extracted.
|
"data_extraction_goal": str, // If the user needs to extract/retrieve data from the site after navigation goal is achieved, define that extraction goal here. null if no data needs to be extracted.
|
||||||
"data_schema": json, // the schema of the output data. use JSON schema specification style. All fields should be optional as we optimize to extract as much data as possible
|
"data_schema": json, // the schema of the output data. use JSON schema specification style. All field names MUST use snake_case (e.g., product_name, order_date). All fields should be optional as we optimize to extract as much data as possible
|
||||||
}
|
}
|
||||||
|
|
||||||
Current datetime, ISO format:
|
Current datetime, ISO format:
|
||||||
|
|||||||
@@ -825,6 +825,7 @@ blocks:
|
|||||||
* Naming Conventions:
|
* Naming Conventions:
|
||||||
- Use descriptive labels: "login_to_portal" not "step1"
|
- Use descriptive labels: "login_to_portal" not "step1"
|
||||||
- Use snake_case for labels and parameter keys
|
- Use snake_case for labels and parameter keys
|
||||||
|
- Use snake_case for data schema field names (e.g., product_name, total_price)
|
||||||
- Make labels unique and meaningful
|
- Make labels unique and meaningful
|
||||||
|
|
||||||
* Goal Writing:
|
* Goal Writing:
|
||||||
|
|||||||
Reference in New Issue
Block a user