- Move global config files to globals iso global folder, as the name global conflicts with python language
- Creation of Traicie Vancancy Definition specialist - Allow to invoke non-interaction specialists from withing Evie's mgmt interface (eveai_app) - Improvements to crewai specialized classes - Introduction to json editor for showing specialists arguments and results in a better way - Introduction of more complex pagination (adding extra arguments) by adding a global 'get_pagination_html' - Allow follow-up of ChatSession / Specialist execution - Improvement in logging of Specialists (but needs to be finished)
This commit is contained in:
@@ -10,6 +10,7 @@ from common.utils.celery_utils import current_celery
|
||||
from common.utils.execution_progress import ExecutionProgressTracker
|
||||
from eveai_api.api.auth import requires_service
|
||||
from common.models.interaction import Specialist
|
||||
from common.services.interaction.specialist_services import SpecialistServices
|
||||
|
||||
specialist_execution_ns = Namespace('specialist-execution', description='Specialist execution operations')
|
||||
|
||||
@@ -24,7 +25,7 @@ class StartSession(Resource):
|
||||
@requires_service("SPECIALIST_API")
|
||||
@specialist_execution_ns.response(201, 'New Session ID created Successfully', specialist_start_session_response)
|
||||
def get(self):
|
||||
new_session_id = f"{uuid.uuid4()}"
|
||||
new_session_id = SpecialistServices.start_session()
|
||||
return {
|
||||
'session_id': new_session_id,
|
||||
}, 201
|
||||
@@ -56,22 +57,16 @@ class StartExecution(Resource):
|
||||
data = specialist_execution_ns.payload
|
||||
|
||||
# Send task to queue
|
||||
task = current_celery.send_task(
|
||||
'execute_specialist',
|
||||
args=[tenant_id,
|
||||
data['specialist_id'],
|
||||
data['arguments'],
|
||||
data['session_id'],
|
||||
data['user_timezone'],
|
||||
],
|
||||
queue='llm_interactions'
|
||||
)
|
||||
result = SpecialistServices.execute_specialist(
|
||||
tenant_id=tenant_id,
|
||||
specialist_id=data['specialist_id'],
|
||||
specialist_arguments=data['arguments'],
|
||||
session_id=data['session_id'],
|
||||
user_timezone=data['user_timezone'])
|
||||
|
||||
return {
|
||||
'task_id': task.id,
|
||||
'status': 'queued',
|
||||
'stream_url': f'/api/v1/specialist-execution/{task.id}/stream'
|
||||
}, 201
|
||||
result['stream_url'] = f"/api/v1/specialist-execution/{result['task_id']}/stream"
|
||||
|
||||
return result, 201
|
||||
|
||||
|
||||
@specialist_execution_ns.route('/<string:task_id>/stream')
|
||||
|
||||
Reference in New Issue
Block a user