Added a few fixes and refactored the base app
This commit is contained in:
parent
3329a14ae8
commit
dd785b85ae
2 changed files with 3 additions and 2 deletions
|
|
@ -23,7 +23,8 @@ class TestOutput(Base):
|
||||||
"""
|
"""
|
||||||
__tablename__ = 'test_outputs'
|
__tablename__ = 'test_outputs'
|
||||||
|
|
||||||
id = Column(String, primary_key=True)
|
set_id = Column(String, primary_key=True)
|
||||||
|
id = Column(String, nullable=True)
|
||||||
user_id = Column(String, ForeignKey('users.id'), index=True) # Added user_id field
|
user_id = Column(String, ForeignKey('users.id'), index=True) # Added user_id field
|
||||||
test_set_id = Column(String, ForeignKey('test_sets.id'), index=True)
|
test_set_id = Column(String, ForeignKey('test_sets.id'), index=True)
|
||||||
operation_id = Column(String, ForeignKey('operations.id'), index=True)
|
operation_id = Column(String, ForeignKey('operations.id'), index=True)
|
||||||
|
|
|
||||||
|
|
@ -412,7 +412,7 @@ async def start_test(data, test_set=None, user_id=None, params=None, job_id=None
|
||||||
for result_list in results[0]:
|
for result_list in results[0]:
|
||||||
for result in result_list:
|
for result in result_list:
|
||||||
print("Here is one result", result)
|
print("Here is one result", result)
|
||||||
await add_entity(session, TestOutput(id=test_id, user_id=user_id, test_results=result['success'], test_score=str(result['score']), test_metric_name=result['metric_name'], test_query=result['query'], test_output=result['output'], test_expected_output=str(['expected_output']), test_context=result['context'][0]))
|
await add_entity(session, TestOutput(id=test_id ,set_id=str(uuid.uuid4()), user_id=user_id, test_results=result['success'], test_score=str(result['score']), test_metric_name=result['metric_name'], test_query=result['query'], test_output=result['output'], test_expected_output=str(['expected_output']), test_context=result['context'][0]))
|
||||||
|
|
||||||
print(results)
|
print(results)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue