Skip to content

Question Playground #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 86 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
94397e1
Initial playground
anmarhindi Jan 14, 2025
949c6e9
Add playground route and search question model
LennartSchmidtKern Jan 14, 2025
e050d0a
initial eval set endpoint
anmarhindi Jan 14, 2025
b705cf5
Upgrade alembic version for eval set
anmarhindi Jan 14, 2025
3a3efc4
similar records
LennartSchmidtKern Jan 14, 2025
e0e5f43
Merge branch 'question-playground' of github.com:code-kern-ai/refiner…
LennartSchmidtKern Jan 14, 2025
a5d6901
restructure
LennartSchmidtKern Jan 16, 2025
ce1c864
Remove alembic upgrade due to db arch changes
anmarhindi Jan 16, 2025
df1c4d4
dummy endpoints
LennartSchmidtKern Jan 16, 2025
613c0c8
adds_refinery_playground_evaluation
anmarhindi Jan 16, 2025
e02e9ee
Merge remote-tracking branch 'origin/question-playground' into questi…
anmarhindi Jan 16, 2025
dfaf220
Remove old matching set
anmarhindi Jan 16, 2025
8024f48
correct names
LennartSchmidtKern Jan 16, 2025
f3a722d
Merge branch 'question-playground' of github.com:code-kern-ai/refiner…
LennartSchmidtKern Jan 16, 2025
d1e6550
evaluation runs
LennartSchmidtKern Jan 16, 2025
65bbe0f
sub ref
anmarhindi Jan 16, 2025
a4119c1
Merge remote-tracking branch 'origin/question-playground' into questi…
anmarhindi Jan 16, 2025
fd643f6
Add getters to playground manager
anmarhindi Jan 16, 2025
4b0e254
renaming. init run
LennartSchmidtKern Jan 17, 2025
1f0efe2
improve results
LennartSchmidtKern Jan 17, 2025
35924b1
creation
LennartSchmidtKern Jan 17, 2025
cd04737
init run
LennartSchmidtKern Jan 17, 2025
f178efa
simple contains search
LennartSchmidtKern Jan 17, 2025
74a0fc8
user fix
LennartSchmidtKern Jan 17, 2025
fb9b97e
fix search, expand
LennartSchmidtKern Jan 17, 2025
bca7ddb
fix formato, add limit
LennartSchmidtKern Jan 20, 2025
ff3a840
limit
LennartSchmidtKern Jan 20, 2025
f8b16e7
Remove unused auth manager
anmarhindi Jan 20, 2025
b419d8d
Add records batch endpoint
anmarhindi Jan 20, 2025
96dd695
fix evaluation run
LennartSchmidtKern Jan 20, 2025
2205612
Add Evaluation set by group endpoint
anmarhindi Jan 21, 2025
f4823da
Add auth check for project access endpoints
anmarhindi Jan 21, 2025
8ccc7da
delete endpoints
LennartSchmidtKern Jan 21, 2025
c1e4396
Merge branch 'question-playground' of github.com:code-kern-ai/refiner…
LennartSchmidtKern Jan 21, 2025
5cda593
Get evaluation run by id
lumburovskalina Jan 21, 2025
c316a64
Merge branch 'question-playground' of github.com:code-kern-ai/refiner…
lumburovskalina Jan 21, 2025
c31ec8f
change result data
LennartSchmidtKern Jan 21, 2025
f8ce5d7
Merge branch 'question-playground' of github.com:code-kern-ai/refiner…
LennartSchmidtKern Jan 21, 2025
b1bcb8f
snake case results
LennartSchmidtKern Jan 21, 2025
af6c4d3
fix naming
LennartSchmidtKern Jan 23, 2025
ffb1661
filter
LennartSchmidtKern Jan 23, 2025
5a163f6
Fixed evaluation run by id request
lumburovskalina Jan 24, 2025
7a81b47
Delete evaluation runs
lumburovskalina Jan 24, 2025
da5440c
fix recrods
LennartSchmidtKern Jan 27, 2025
4045257
concurrency and limits
LennartSchmidtKern Jan 28, 2025
3e2333b
threshold
LennartSchmidtKern Jan 28, 2025
44f2a88
threshold run
LennartSchmidtKern Jan 28, 2025
8b90ceb
user id fix
LennartSchmidtKern Jan 28, 2025
dc9d467
reformulation prompt
LennartSchmidtKern Jan 30, 2025
4bedf4d
requirements
LennartSchmidtKern Jan 31, 2025
5fb8d6b
change output
LennartSchmidtKern Jan 31, 2025
372c2c4
api key dyn
LennartSchmidtKern Jan 31, 2025
a1527a2
Simple error handling for reformulation
anmarhindi Jan 31, 2025
9c04442
group fetch
LennartSchmidtKern Feb 3, 2025
0d436a6
Merge branch 'question-playground' of github.com:code-kern-ai/refiner…
LennartSchmidtKern Feb 3, 2025
ed9ab38
improve record fetching
LennartSchmidtKern Feb 3, 2025
e1d9787
record batch
LennartSchmidtKern Feb 3, 2025
354f59d
simplifiy args
LennartSchmidtKern Feb 3, 2025
0ff0f71
fix exception
LennartSchmidtKern Feb 3, 2025
6d5013a
Remove redundant check, delegate to json loads raise
anmarhindi Feb 3, 2025
b0d60a2
Add playground question model
anmarhindi Feb 4, 2025
f01901a
Change endpoint handling of saveQuestion
anmarhindi Feb 4, 2025
6cc8651
Add initial get playground questions endpoint
anmarhindi Feb 4, 2025
51b11f0
sub ref
anmarhindi Feb 4, 2025
ddbab82
sub ref
anmarhindi Feb 4, 2025
1204b2b
Delegate save question to neural search
anmarhindi Feb 4, 2025
709728e
Update model and manager
anmarhindi Feb 4, 2025
b9c4fd7
sub ref
anmarhindi Feb 4, 2025
62ae6a0
Enable project access check
anmarhindi Feb 4, 2025
a0fcc4e
list comp
anmarhindi Feb 4, 2025
b2df18b
Use adjusted run state from enum
anmarhindi Feb 6, 2025
304da3e
Rename base uri
anmarhindi Feb 6, 2025
2ad52c6
eval run function
LennartSchmidtKern Feb 6, 2025
6260898
Merge branch 'question-playground' of github.com:code-kern-ai/refiner…
LennartSchmidtKern Feb 6, 2025
0848d56
Resolve tensor via connector
anmarhindi Feb 6, 2025
ec02d1f
Merge remote-tracking branch 'origin/question-playground' into questi…
anmarhindi Feb 6, 2025
878595d
Get tensor for text via connector
anmarhindi Feb 6, 2025
19a359b
Remove unused import
anmarhindi Feb 6, 2025
7278172
Get enum value for state
anmarhindi Feb 6, 2025
1d8da3d
sub ref
anmarhindi Feb 6, 2025
c698650
sub ref
anmarhindi Feb 6, 2025
672eeb0
sub ref
anmarhindi Feb 6, 2025
8bd9f9a
sub ref
anmarhindi Feb 6, 2025
79ad2df
Add traceback to exception handling
anmarhindi Feb 6, 2025
2c4fc72
Deleting questions and order desc
lumburovskalina Feb 7, 2025
91ba23a
sub ref
anmarhindi Feb 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions alembic/versions/0c8eb3ff1c71_adds_playground_question.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""adds_playground_question

Revision ID: 0c8eb3ff1c71
Revises: ac97442726d2
Create Date: 2025-02-04 09:48:41.971287

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '0c8eb3ff1c71'
down_revision = 'ac97442726d2'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('playground_question',
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('question', sa.String(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('project_id', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('embedding_id', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('record_ids', sa.JSON(), nullable=True),
sa.Column('meta_info', sa.JSON(), nullable=True),
sa.ForeignKeyConstraint(['created_by'], ['user.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['embedding_id'], ['embedding.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['project_id'], ['project.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_playground_question_created_by'), 'playground_question', ['created_by'], unique=False)
op.create_index(op.f('ix_playground_question_embedding_id'), 'playground_question', ['embedding_id'], unique=False)
op.create_index(op.f('ix_playground_question_project_id'), 'playground_question', ['project_id'], unique=False)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_playground_question_project_id'), table_name='playground_question')
op.drop_index(op.f('ix_playground_question_embedding_id'), table_name='playground_question')
op.drop_index(op.f('ix_playground_question_created_by'), table_name='playground_question')
op.drop_table('playground_question')
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
"""adds_refinery_playground_evaluation

Revision ID: ac97442726d2
Revises: eb5ecbee5090
Create Date: 2025-01-16 13:26:43.059523

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'ac97442726d2'
down_revision = 'eb5ecbee5090'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('evaluation_group',
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('name', sa.String(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('project_id', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('evaluation_set_ids', sa.JSON(), nullable=True),
sa.ForeignKeyConstraint(['created_by'], ['user.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['project_id'], ['project.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_evaluation_group_created_by'), 'evaluation_group', ['created_by'], unique=False)
op.create_index(op.f('ix_evaluation_group_project_id'), 'evaluation_group', ['project_id'], unique=False)
op.create_table('evaluation_set',
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('question', sa.String(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('project_id', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('record_ids', sa.JSON(), nullable=True),
sa.ForeignKeyConstraint(['created_by'], ['user.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['project_id'], ['project.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_evaluation_set_created_by'), 'evaluation_set', ['created_by'], unique=False)
op.create_index(op.f('ix_evaluation_set_project_id'), 'evaluation_set', ['project_id'], unique=False)
op.create_table('evaluation_run',
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('evaluation_group_id', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('created_by', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('project_id', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('embedding_id', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('state', sa.String(), nullable=True),
sa.Column('results', sa.JSON(), nullable=True),
sa.Column('meta_info', sa.JSON(), nullable=True),
sa.ForeignKeyConstraint(['created_by'], ['user.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['embedding_id'], ['embedding.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['evaluation_group_id'], ['evaluation_group.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['project_id'], ['project.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_evaluation_run_created_by'), 'evaluation_run', ['created_by'], unique=False)
op.create_index(op.f('ix_evaluation_run_embedding_id'), 'evaluation_run', ['embedding_id'], unique=False)
op.create_index(op.f('ix_evaluation_run_evaluation_group_id'), 'evaluation_run', ['evaluation_group_id'], unique=False)
op.create_index(op.f('ix_evaluation_run_project_id'), 'evaluation_run', ['project_id'], unique=False)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_evaluation_run_project_id'), table_name='evaluation_run')
op.drop_index(op.f('ix_evaluation_run_evaluation_group_id'), table_name='evaluation_run')
op.drop_index(op.f('ix_evaluation_run_embedding_id'), table_name='evaluation_run')
op.drop_index(op.f('ix_evaluation_run_created_by'), table_name='evaluation_run')
op.drop_table('evaluation_run')
op.drop_index(op.f('ix_evaluation_set_project_id'), table_name='evaluation_set')
op.drop_index(op.f('ix_evaluation_set_created_by'), table_name='evaluation_set')
op.drop_table('evaluation_set')
op.drop_index(op.f('ix_evaluation_group_project_id'), table_name='evaluation_group')
op.drop_index(op.f('ix_evaluation_group_created_by'), table_name='evaluation_group')
op.drop_table('evaluation_group')
# ### end Alembic commands ###
6 changes: 5 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from fast_api.routes.weak_supervision import router as weak_supervision_router
from fast_api.routes.labeling_tasks import router as labeling_tasks_router
from fast_api.routes.task_execution import router as task_execution_router
from fast_api.routes.playground import router as playground_router
from middleware.database_session import handle_db_session
from middleware.starlette_tmp_middleware import DatabaseSessionHandler
from starlette.applications import Starlette
Expand All @@ -55,6 +56,7 @@
PREFIX_WEAK_SUPERVISION,
PREFIX_LABELING_TASKS,
PREFIX_TASK_EXECUTION,
PREFIX_PLAYGROUND,
)
from util import security, clean_up
from middleware import log_storage
Expand Down Expand Up @@ -106,7 +108,9 @@
fastapi_app.include_router(
labeling_tasks_router, prefix=PREFIX_LABELING_TASKS, tags=["labeling-tasks"]
)

fastapi_app.include_router(
playground_router, prefix=PREFIX_PLAYGROUND, tags=["playground"]
)
fastapi_app_internal = FastAPI()
fastapi_app_internal.include_router(
task_execution_router, prefix=PREFIX_TASK_EXECUTION, tags=["task-execution"]
Expand Down
Empty file.
Loading