Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix task v2 data schema #1967

Merged
merged 1 commit into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion skyvern/forge/prompts/skyvern/task_v2_summary.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ User goal:
{{ user_goal }}
```{% if extracted_information_schema %}

The ideal schema for the "output" field: {{ extracted_information_schema }}{% endif %}
The ideal schema for the "output" field:
```
{{ extracted_information_schema }}
```{% endif %}

Task history (the earliest task is the first in the list and the latest is the last in the list):
```
Expand Down
4 changes: 4 additions & 0 deletions skyvern/forge/sdk/db/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2251,6 +2251,8 @@ async def create_task_v2(
totp_identifier: str | None = None,
totp_verification_url: str | None = None,
webhook_callback_url: str | None = None,
extracted_information_schema: dict | list | str | None = None,
error_code_mapping: dict | None = None,
) -> TaskV2:
async with self.Session() as session:
new_task_v2 = TaskV2Model(
Expand All @@ -2263,6 +2265,8 @@ async def create_task_v2(
totp_identifier=totp_identifier,
totp_verification_url=totp_verification_url,
webhook_callback_url=webhook_callback_url,
extracted_information_schema=extracted_information_schema,
error_code_mapping=error_code_mapping,
organization_id=organization_id,
)
session.add(new_task_v2)
Expand Down
2 changes: 2 additions & 0 deletions skyvern/forge/sdk/routes/agent_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,8 @@ async def run_task_v2(
proxy_location=data.proxy_location,
publish_workflow=data.publish_workflow,
create_task_run=True,
extracted_information_schema=data.extracted_information_schema,
error_code_mapping=data.error_code_mapping,
)
except LLMProviderError:
LOG.error("LLM failure to initialize task v2", exc_info=True)
Expand Down
4 changes: 4 additions & 0 deletions skyvern/forge/sdk/services/task_v2_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ async def initialize_task_v2(
publish_workflow: bool = False,
parent_workflow_run_id: str | None = None,
create_task_run: bool = False,
extracted_information_schema: dict | list | str | None = None,
error_code_mapping: dict | None = None,
) -> TaskV2:
task_v2 = await app.DATABASE.create_task_v2(
prompt=user_prompt,
Expand All @@ -104,6 +106,8 @@ async def initialize_task_v2(
totp_identifier=totp_identifier,
webhook_callback_url=webhook_callback_url,
proxy_location=proxy_location,
extracted_information_schema=extracted_information_schema,
error_code_mapping=error_code_mapping,
)
# set task_v2_id in context
context = skyvern_context.current()
Expand Down
Loading