Integration Operations¶
Integration operations between bot and agent systems.
- async shared.database.operations.integration.complete_task_processing(task_id, success=True, error_message=None)[source]¶
Complete task processing and update status.
- async shared.database.operations.integration.create_research_topic_for_user_task(user_task)[source]¶
Create a ResearchTopic from UserTask for agent compatibility.
This bridges the new UserTask system with the legacy ResearchTopic system that the agent pipeline expects.
- Parameters:
user_task (
UserTask
) – UserTask instance- Return type:
- Returns:
ResearchTopic instance or None if user not found
- async shared.database.operations.integration.create_user_task(user_id, description)[source]¶
Create a user task (legacy function for compatibility).
- async shared.database.operations.integration.get_next_queued_task()[source]¶
Get next task from queue for agent processing.
This function bridges the new UserTask/TaskQueue system with the agent.
- async shared.database.operations.integration.get_user_task_results(task_id)[source]¶
Get analysis results for a user task.
- Parameters:
task_id (
int
) – UserTask ID- Return type:
- Returns:
List of (PaperAnalysis, ArxivPaper) tuples
- async shared.database.operations.integration.link_analysis_to_user_task(analysis, user_task)[source]¶
Link a paper analysis to a user task for proper result tracking.
Creates a Finding record that connects the analysis to the user’s task.
- Parameters:
analysis (
PaperAnalysis
) – PaperAnalysis instanceuser_task (
UserTask
) – UserTask instance
- Return type: