feat: add outputs field to message model and enhance advanced chat task pipeline
- Introduced `outputs` field in the Message model to store output data. - Updated `generate_task_pipeline.py` to handle and print outputs during task processing. - Enhanced the answer node components to utilize the new outputs field, including filtering and displaying output variables. - Added necessary adjustments in the TypeScript types for better integration with the new outputs functionality.pull/20921/head
parent
db83bfc53a
commit
a36533a5ec
@ -0,0 +1,33 @@
|
|||||||
|
"""Update Message table outputs column to text and add outputs_dict property
|
||||||
|
|
||||||
|
Revision ID: 83f1262d3f22
|
||||||
|
Revises: 2adcbe1f5dfb
|
||||||
|
Create Date: 2025-06-03 12:29:08.619582
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import models as models
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '83f1262d3f22'
|
||||||
|
down_revision = '2adcbe1f5dfb'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('messages', schema=None) as batch_op:
|
||||||
|
batch_op.add_column(sa.Column('outputs', sa.Text(), server_default=sa.text("'{}'::text"), nullable=True))
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('messages', schema=None) as batch_op:
|
||||||
|
batch_op.drop_column('outputs')
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import type { CommonNodeType, Variable } from '@/app/components/workflow/types'
|
import type { CommonNodeType, Variable } from '@/app/components/workflow/types'
|
||||||
|
|
||||||
export type AnswerNodeType = CommonNodeType & {
|
export type AnswerNodeType = CommonNodeType & {
|
||||||
|
outputs: Variable[]
|
||||||
variables: Variable[]
|
variables: Variable[]
|
||||||
answer: string
|
answer: string
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue