feat(agent): add support for workflow agents with updated constraints and configuration

This commit is contained in:
Davidson Gomes
2025-05-06 18:37:13 -03:00
parent 64e483533d
commit 0fc47aaa57
5 changed files with 97 additions and 8 deletions

View File

@@ -0,0 +1,49 @@
"""worflow_agent
Revision ID: ebac70616dab
Revises: c107446e38aa
Create Date: 2025-05-06 17:05:26.884902
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "ebac70616dab"
down_revision: Union[str, None] = "c107446e38aa"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
# Remover a constraint antiga
op.drop_constraint("check_agent_type", "agents", type_="check")
# Adicionar a nova constraint que inclui o tipo 'workflow'
op.create_check_constraint(
"check_agent_type",
"agents",
"type IN ('llm', 'sequential', 'parallel', 'loop', 'a2a', 'workflow')",
)
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
# Remover a constraint nova
op.drop_constraint("check_agent_type", "agents", type_="check")
# Restaurar a constraint anterior sem o tipo 'workflow'
op.create_check_constraint(
"check_agent_type",
"agents",
"type IN ('llm', 'sequential', 'parallel', 'loop', 'a2a')",
)
# ### end Alembic commands ###