- Implementation of specialist execution api, including SSE protocol

- eveai_chat becomes deprecated and should be replaced with SSE
- Adaptation of STANDARD_RAG specialist
- Base class definition allowing to realise specialists with crewai framework
- Implementation of SPIN_SPECIALIST
- Implementation of test app for testing specialists (test_specialist_client). Also serves as an example for future SSE-based client
- Improvements to startup scripts to better handle and scale multiple connections
- Small improvements to the interaction forms and views
- Caching implementation improved and augmented with additional caches
This commit is contained in:
Josako
2025-02-20 05:50:16 +01:00
parent d106520d22
commit 25213f2004
79 changed files with 2791 additions and 347 deletions

View File

@@ -0,0 +1,41 @@
"""Specialist STANDARD_RAG renamed
Revision ID: 209ae2db55f0
Revises: b9cc547a0512
Create Date: 2025-02-08 14:58:29.960295
"""
from alembic import op
import sqlalchemy as sa
import pgvector
from sqlalchemy import table, column, String
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '209ae2db55f0'
down_revision = 'b9cc547a0512'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
# Define specialist table structure needed for the update
specialist = table('specialist',
column('id', sa.Integer),
column('type', String)
)
# Update all specialists with type STANDARD_RAG to STANDARD_RAG_SPECIALIST
op.execute(
specialist.update().
where(specialist.c.type == 'STANDARD_RAG').
values(type='STANDARD_RAG_SPECIALIST')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@@ -0,0 +1,44 @@
"""Add type_version default for specialist
Revision ID: 6857672e8164
Revises: 209ae2db55f0
Create Date: 2025-02-10 04:45:46.336174
"""
from alembic import op
import sqlalchemy as sa
import pgvector
from sqlalchemy import table, column, String, text
from sqlalchemy.dialects import postgresql
from sqlalchemy.exc import SQLAlchemyError
# revision identifiers, used by Alembic.
revision = '6857672e8164'
down_revision = '209ae2db55f0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
connection = op.get_bind()
table_name = 'specialist'
try:
result = connection.execute(
text(f"""
UPDATE {table_name}
SET type_version = '1.0.0'
WHERE type_version IS NULL OR type_version = ''
""")
)
print(f"Updated {result.rowcount} rows for type_version in {table_name}")
except SQLAlchemyError as e:
print(f"Error updating type_version in {table_name}: {str(e)}")
raise
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@@ -0,0 +1,29 @@
"""Add version_type to Retriever model
Revision ID: b9cc547a0512
Revises: efcd6a0d2989
Create Date: 2025-01-24 06:56:33.459264
"""
from alembic import op
import sqlalchemy as sa
import pgvector
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'b9cc547a0512'
down_revision = 'efcd6a0d2989'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('retriever', sa.Column('type_version', sa.String(length=20), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('retriever', 'type_version')
# ### end Alembic commands ###

View File

@@ -0,0 +1,44 @@
"""Update Retriever type_version to 1.0.0
Revision ID: e58835fadd96
Revises: 6857672e8164
Create Date: 2025-02-10 12:20:22.748172
"""
from alembic import op
import sqlalchemy as sa
import pgvector
from sqlalchemy import text
from sqlalchemy.dialects import postgresql
from sqlalchemy.exc import SQLAlchemyError
# revision identifiers, used by Alembic.
revision = 'e58835fadd96'
down_revision = '6857672e8164'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
connection = op.get_bind()
table_name = 'retriever'
try:
result = connection.execute(
text(f"""
UPDATE {table_name}
SET type_version = '1.0.0'
WHERE type_version IS NULL OR type_version = ''
""")
)
print(f"Updated {result.rowcount} rows for type_version in {table_name}")
except SQLAlchemyError as e:
print(f"Error updating type_version in {table_name}: {str(e)}")
raise
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###