Improve Video Learning Agent with action-based detection and analysis toggle
- Change video detection from screenshot hash to action-based (Swipe detection) - Add enable_analysis toggle to disable VLM screenshot analysis - Improve task prompt to prevent VLM from stopping prematurely - Add debug logging for action detection troubleshooting - Fix ModelResponse attribute error (content -> raw_content) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ const VideoLearningModule = {
|
||||
targetCount = 10,
|
||||
category = null,
|
||||
watchDuration = 3.0,
|
||||
enableAnalysis = true,
|
||||
} = options;
|
||||
|
||||
try {
|
||||
@@ -28,6 +29,7 @@ const VideoLearningModule = {
|
||||
target_count: targetCount,
|
||||
category: category,
|
||||
watch_duration: watchDuration,
|
||||
enable_analysis: enableAnalysis,
|
||||
});
|
||||
|
||||
this.currentSessionId = response.data.session_id;
|
||||
|
||||
@@ -97,6 +97,14 @@
|
||||
<small>Leave empty to watch recommended videos</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group checkbox-group">
|
||||
<label>
|
||||
<input type="checkbox" v-model="config.enableAnalysis" :disabled="loading">
|
||||
<span>Enable Screenshot Analysis</span>
|
||||
</label>
|
||||
<small>Analyze video content using VLM to extract description, likes, comments, tags, etc.</small>
|
||||
</div>
|
||||
|
||||
<button @click="createAndStartSession" class="btn btn-primary" :disabled="loading || !config.deviceId">
|
||||
<svg v-if="loading" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="spinning">
|
||||
<path d="M21 12a9 9 0 1 1-6.219-8.56"></path>
|
||||
@@ -269,6 +277,7 @@
|
||||
targetCount: 10,
|
||||
category: '',
|
||||
watchDuration: 3.0,
|
||||
enableAnalysis: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -304,6 +313,7 @@
|
||||
targetCount: this.config.targetCount,
|
||||
category: this.config.category || null,
|
||||
watchDuration: this.config.watchDuration,
|
||||
enableAnalysis: this.config.enableAnalysis,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -354,7 +364,12 @@
|
||||
|
||||
try {
|
||||
await VideoLearningModule.controlSession(this.currentSessionId, 'stop');
|
||||
await this.updateSessionStatus();
|
||||
// Stop polling first
|
||||
VideoLearningModule.stopPolling();
|
||||
// Mark session as stopped in UI
|
||||
if (this.sessionStatus) {
|
||||
this.sessionStatus.is_active = false;
|
||||
}
|
||||
this.showToast('Session stopped', 'info');
|
||||
} catch (error) {
|
||||
this.showToast('Failed to stop session', 'error');
|
||||
|
||||
Reference in New Issue
Block a user