Session_id was not correctly stored for chat sessions, and it was defined as an integer iso a UUID in the database
This commit is contained in:
@@ -14,8 +14,8 @@ class BusinessEventLog(db.Model):
|
|||||||
span_name = db.Column(db.String(50))
|
span_name = db.Column(db.String(50))
|
||||||
parent_span_id = db.Column(db.String(50))
|
parent_span_id = db.Column(db.String(50))
|
||||||
document_version_id = db.Column(db.Integer)
|
document_version_id = db.Column(db.Integer)
|
||||||
chat_session_id = db.Column(db.Integer)
|
chat_session_id = db.Column(db.String(50))
|
||||||
interaction_id = db.Column(db.Integer)
|
interaction_id = db.Column(db.Integer)
|
||||||
environment = db.Column(db.String(20))
|
environment = db.Column(db.String(20))
|
||||||
message = db.Column(db.Text)
|
message = db.Column(db.Text)
|
||||||
# Add any other fields relevant for invoicing or warnings
|
# Add any other fields relevant for invoicing or warnings
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ def ask_question(tenant_id, question, language, session_id, user_timezone, room)
|
|||||||
'interaction_id': 'interaction_id_value'
|
'interaction_id': 'interaction_id_value'
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
with BusinessEvent("Ask Question", tenant_id=tenant_id, session_id=session_id):
|
with BusinessEvent("Ask Question", tenant_id=tenant_id, chat_session_id=session_id):
|
||||||
current_app.logger.info(f'ask_question: Received question for tenant {tenant_id}: {question}. Processing...')
|
current_app.logger.info(f'ask_question: Received question for tenant {tenant_id}: {question}. Processing...')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
"""session_id is uuid iso integeger
|
||||||
|
|
||||||
|
Revision ID: 829094f07d44
|
||||||
|
Revises: 2cbdb23ae02e
|
||||||
|
Create Date: 2024-09-27 09:19:13.201988
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '829094f07d44'
|
||||||
|
down_revision = '2cbdb23ae02e'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('business_event_log', schema=None) as batch_op:
|
||||||
|
batch_op.alter_column('chat_session_id',
|
||||||
|
existing_type=sa.INTEGER(),
|
||||||
|
type_=sa.String(length=50),
|
||||||
|
existing_nullable=True)
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('business_event_log', schema=None) as batch_op:
|
||||||
|
batch_op.alter_column('chat_session_id',
|
||||||
|
existing_type=sa.String(length=50),
|
||||||
|
type_=sa.INTEGER(),
|
||||||
|
existing_nullable=True)
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
Reference in New Issue
Block a user