fix task v2 data schema (#1967)
This commit is contained in:
@@ -13,7 +13,10 @@ User goal:
|
|||||||
{{ user_goal }}
|
{{ user_goal }}
|
||||||
```{% if extracted_information_schema %}
|
```{% 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):
|
Task history (the earliest task is the first in the list and the latest is the last in the list):
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -2251,6 +2251,8 @@ class AgentDB:
|
|||||||
totp_identifier: str | None = None,
|
totp_identifier: str | None = None,
|
||||||
totp_verification_url: str | None = None,
|
totp_verification_url: str | None = None,
|
||||||
webhook_callback_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:
|
) -> TaskV2:
|
||||||
async with self.Session() as session:
|
async with self.Session() as session:
|
||||||
new_task_v2 = TaskV2Model(
|
new_task_v2 = TaskV2Model(
|
||||||
@@ -2263,6 +2265,8 @@ class AgentDB:
|
|||||||
totp_identifier=totp_identifier,
|
totp_identifier=totp_identifier,
|
||||||
totp_verification_url=totp_verification_url,
|
totp_verification_url=totp_verification_url,
|
||||||
webhook_callback_url=webhook_callback_url,
|
webhook_callback_url=webhook_callback_url,
|
||||||
|
extracted_information_schema=extracted_information_schema,
|
||||||
|
error_code_mapping=error_code_mapping,
|
||||||
organization_id=organization_id,
|
organization_id=organization_id,
|
||||||
)
|
)
|
||||||
session.add(new_task_v2)
|
session.add(new_task_v2)
|
||||||
|
|||||||
@@ -1133,6 +1133,8 @@ async def run_task_v2(
|
|||||||
proxy_location=data.proxy_location,
|
proxy_location=data.proxy_location,
|
||||||
publish_workflow=data.publish_workflow,
|
publish_workflow=data.publish_workflow,
|
||||||
create_task_run=True,
|
create_task_run=True,
|
||||||
|
extracted_information_schema=data.extracted_information_schema,
|
||||||
|
error_code_mapping=data.error_code_mapping,
|
||||||
)
|
)
|
||||||
except LLMProviderError:
|
except LLMProviderError:
|
||||||
LOG.error("LLM failure to initialize task v2", exc_info=True)
|
LOG.error("LLM failure to initialize task v2", exc_info=True)
|
||||||
|
|||||||
@@ -96,6 +96,8 @@ async def initialize_task_v2(
|
|||||||
publish_workflow: bool = False,
|
publish_workflow: bool = False,
|
||||||
parent_workflow_run_id: str | None = None,
|
parent_workflow_run_id: str | None = None,
|
||||||
create_task_run: bool = False,
|
create_task_run: bool = False,
|
||||||
|
extracted_information_schema: dict | list | str | None = None,
|
||||||
|
error_code_mapping: dict | None = None,
|
||||||
) -> TaskV2:
|
) -> TaskV2:
|
||||||
task_v2 = await app.DATABASE.create_task_v2(
|
task_v2 = await app.DATABASE.create_task_v2(
|
||||||
prompt=user_prompt,
|
prompt=user_prompt,
|
||||||
@@ -104,6 +106,8 @@ async def initialize_task_v2(
|
|||||||
totp_identifier=totp_identifier,
|
totp_identifier=totp_identifier,
|
||||||
webhook_callback_url=webhook_callback_url,
|
webhook_callback_url=webhook_callback_url,
|
||||||
proxy_location=proxy_location,
|
proxy_location=proxy_location,
|
||||||
|
extracted_information_schema=extracted_information_schema,
|
||||||
|
error_code_mapping=error_code_mapping,
|
||||||
)
|
)
|
||||||
# set task_v2_id in context
|
# set task_v2_id in context
|
||||||
context = skyvern_context.current()
|
context = skyvern_context.current()
|
||||||
|
|||||||
Reference in New Issue
Block a user