Skip to content

लाइव एजेंट मूल्यांकन

AI एजेंट को असल समय में काम करते देखें और pause, instruct तथा takeover नियंत्रणों से चलते-चलते उसके व्यवहार का एनोटेशन करें। Anthropic, Ollama और Claude SDK के साथ वेब तथा कोडिंग एजेंट समर्थित हैं।

v2.4.0 में नया

लाइव एजेंट मूल्यांकन एनोटेटरों को किसी AI एजेंट को असल समय में वेब ब्राउज़ करते देखने और चलते-चलते उसके व्यवहार का एनोटेशन करने देता है — बाद में नहीं। एजेंट स्क्रीनशॉट लेता है, उन्हें विज़न LLM को भेजता है, क्रियाएँ पाता है, और उन्हें एक headless ब्राउज़र में चलाता है। हर चरण एनोटेटर की स्क्रीन पर लाइव स्ट्रीम होता है।

आवश्यकताएँ

bash
pip install playwright anthropic
playwright install chromium
export ANTHROPIC_API_KEY=your_key_here

कॉन्फ़िगरेशन

yaml
live_agent:
  endpoint_type: anthropic_vision
  ai_config:
    model: claude-sonnet-4-20250514
    api_key: ${ANTHROPIC_API_KEY}
    max_tokens: 4096
    temperature: 0.3
  system_prompt: |
    You are a web browsing agent. Complete the given task efficiently.
    At each step, describe your thought, then output an action.
  max_steps: 30
  step_delay: 1.0
  viewport:
    width: 1280
    height: 720
  allow_takeover: true
  allow_instructions: true
 
instance_display:
  fields:
    - key: task_description
      type: text
      label: "Task"
    - key: agent_trace
      type: live_agent
      label: "Live Agent Session"
      display_options:
        show_overlays: true
        show_filmstrip: true
        show_thought: true
        show_controls: true

कॉन्फ़िगरेशन संदर्भ

विकल्पटाइपडिफ़ॉल्टविवरण
endpoint_typestringanthropic_visionएजेंट के लिए LLM प्रदाता
ai_config.modelstringclaude-sonnet-4-20250514इस्तेमाल किया जाने वाला मॉडल
ai_config.api_keystringenv varAPI कुंजी (${VAR} सिंटैक्स इस्तेमाल करें)
ai_config.max_tokensint4096प्रति LLM उत्तर अधिकतम token
ai_config.temperaturefloat0.3सैंपलिंग temperature
system_promptstringbuilt-inएजेंट के लिए सिस्टम prompt
max_stepsint30रुकने से पहले अधिकतम चरण
step_delayfloat1.0चरणों के बीच सेकंड
viewport.widthint1280ब्राउज़र viewport चौड़ाई
viewport.heightint720ब्राउज़र viewport ऊँचाई
allow_takeoverbooltrueएनोटेटरों को मैनुअल नियंत्रण लेने दें
allow_instructionsbooltrueएनोटेटरों को बीच रन में निर्देश भेजने दें
history_windowint5LLM संदर्भ में शामिल हालिया चरणों की संख्या

डेटा फ़ॉर्मैट

हर instance काम और शुरुआती URL देता है:

json
{
  "id": "task_001",
  "task_description": "Search for climate change on Wikipedia and find the year it was first described",
  "start_url": "https://en.wikipedia.org"
}

एनोटेटर कार्यप्रवाह

  1. एनोटेटर काम का विवरण पढ़ता है और Start Agent पर क्लिक करता है
  2. एक headless Chromium ब्राउज़र शुरू होता है और LLM से जुड़ता है
  3. एजेंट के नेविगेट करते-करते स्क्रीनशॉट व्यूअर में लाइव स्ट्रीम होते हैं — हर चरण में स्क्रीनशॉट, एजेंट का विचार, और की गई क्रिया दिखती है
  4. एनोटेटर कंट्रोल पैनल से अंतःक्रिया कर सकता है:
    • Pause / Resume — एजेंट को चरणों के बीच रोकें
    • Send Instructions — बीच रन में एजेंट के संदर्भ में एक संदेश डालें
    • Take Over — मैनुअल ब्राउज़िंग नियंत्रण पर जाएँ
    • Stop — सेशन जल्दी ख़त्म करें
  5. सेशन पूरा होने पर (सफलता, विफलता, या max_steps तक पहुँचने पर) ट्रेस सहेजा जाता है और डिस्प्ले समीक्षा मोड में बदल जाता है
  6. एनोटेटर एजेंट के प्रदर्शन को आँकने के लिए एनोटेशन स्कीमा भरता है

कीबोर्ड शॉर्टकट

कुंजीक्रिया
SpacePause / Resume
Escapeसेशन रोकें

एनोटेशन स्कीमा जोड़ना

लाइव एजेंट डिस्प्ले को किसी भी Potato एनोटेशन स्कीमा के साथ जोड़ें:

yaml
annotation_schemes:
  - annotation_type: radio
    name: task_success
    question: "Did the agent complete the task?"
    labels:
      - name: "Yes, fully"
      - name: "Partially"
      - name: "No"
  - annotation_type: likert
    name: efficiency
    question: "How efficiently did the agent work?"
    min_label: "Very inefficient"
    max_label: "Very efficient"
    scale: 5
  - annotation_type: text
    name: errors_observed
    question: "Describe any errors or unnecessary steps"
  - annotation_type: span
    name: error_steps
    question: "Mark any steps where the agent made an error"
    labels:
      - name: hallucination
      - name: wrong_target
      - name: unnecessary_action

पूरा उदाहरण

yaml
task_name: "Live Agent Evaluation Study"
task_dir: "."
 
live_agent:
  endpoint_type: anthropic_vision
  ai_config:
    model: claude-sonnet-4-20250514
    api_key: ${ANTHROPIC_API_KEY}
    max_tokens: 4096
    temperature: 0.3
  max_steps: 25
  step_delay: 1.5
  viewport:
    width: 1280
    height: 720
  allow_takeover: true
  allow_instructions: true
  history_window: 5
 
data_files:
  - "tasks.jsonl"
 
instance_display:
  fields:
    - key: task_description
      type: text
      label: "Task"
    - key: agent_trace
      type: live_agent
      label: "Live Session"
      display_options:
        show_overlays: true
        show_filmstrip: true
        show_thought: true
        show_controls: true
 
annotation_schemes:
  - annotation_type: radio
    name: task_success
    question: "Did the agent complete the task?"
    labels:
      - name: "Yes"
      - name: "Partially"
      - name: "No"
  - annotation_type: likert
    name: efficiency
    question: "Rate the agent's efficiency"
    scale: 5
    min_label: "Very inefficient"
    max_label: "Very efficient"
  - annotation_type: text
    name: notes
    question: "Notes on agent behavior"
 
output_annotation_dir: "output/"
output_annotation_format: "jsonl"

आर्किटेक्चर

लाइव एजेंट Flask में एक बैकग्राउंड थ्रेड के रूप में चलता है। स्क्रीनशॉट और स्थिति के बदलाव Server-Sent Events (SSE) के ज़रिए ब्राउज़र तक स्ट्रीम होते हैं। एनोटेटर के नियंत्रण (pause, instruct, takeover, stop) उन REST एंडपॉइंट को कॉल करते हैं जो बैकग्राउंड थ्रेड के साथ तालमेल रखते हैं।

text
Annotator (browser)  <── SSE stream ──  Flask Server  ── Playwright ──► Headless Browser
                     ──► REST control ─►              ◄── LLM API ────► Claude Vision

स्क्रीनशॉट {task_dir}/live_sessions/ में सहेजे जाते हैं और फ़िल्मस्ट्रिप दृश्य के लिए API के ज़रिए परोसे जाते हैं।

ट्रेस निर्यात

सेशन पूरा होने पर Potato पूरे ट्रेस को अपने आप web_agent_trace-संगत JSON के रूप में निर्यात करता है, जिसमें ये शामिल होते हैं:

  • स्क्रीनशॉट, क्रियाओं, विचारों और observation सहित सारे चरण
  • एनोटेटर द्वारा बीच रन में भेजे गए सारे निर्देश
  • टाइमस्टैम्प और एजेंट कॉन्फ़िगरेशन मेटाडेटा
  • एनोटेटर के takeover की घटनाएँ

यानी पूरे हो चुके लाइव सेशन को बाद में मानक वेब एजेंट एनोटेशन व्यूअर से देखा जा सकता है।

समस्या निवारण

"Playwright is not installed"pip install playwright && playwright install chromium चलाएँ।

"Anthropic API key required"ANTHROPIC_API_KEY एनवायरनमेंट वेरिएबल सेट करें या अपने कॉन्फ़िग में api_key: ${ANTHROPIC_API_KEY} इस्तेमाल करें।

एजेंट धीमा लग रहा है — हर चरण में एक LLM API कॉल लगती है (आम तौर पर 3–10 सेकंड)। LLM के प्रोसेस करते समय thinking संकेतक दिखता है। लंबे सेशन तेज़ करने के लिए history_window घटाएँ।

स्क्रीनशॉट लोड नहीं हो रहे — जाँचें कि task_dir में लिखा जा सकता है और सर्वर पर डिस्क जगह बची है।

कोडिंग एजेंट बैकएंड

वेब ब्राउज़िंग एजेंट के अलावा Potato कोडिंग एजेंट के लाइव अवलोकन का भी समर्थन करता है। तीन बैकएंड उपलब्ध हैं:

Ollama (लोकल, बिना API कुंजी)

पूरी तरह लोकल मॉडल के साथ कोडिंग एजेंट मूल्यांकन चलाएँ — किसी API कुंजी की ज़रूरत नहीं।

yaml
live_agent:
  endpoint_type: coding_agent
  backend: ollama
  ai_config:
    model: qwen2.5-coder:7b
    host: "http://localhost:11434"
  max_steps: 50
  project_dir: "./workspace"

Anthropic API

कोडिंग एजेंट मूल्यांकन के लिए टूल इस्तेमाल के साथ Claude चलाएँ।

yaml
live_agent:
  endpoint_type: coding_agent
  backend: anthropic
  ai_config:
    model: claude-sonnet-4-20250514
    api_key: ${ANTHROPIC_API_KEY}
    max_tokens: 8192
  max_steps: 50
  project_dir: "./workspace"

Claude Agent SDK

उन्नत कोडिंग एजेंट सेशन के लिए पूरी Claude Code क्षमताएँ।

yaml
live_agent:
  endpoint_type: coding_agent
  backend: claude_agent_sdk
  ai_config:
    max_turns: 50
  project_dir: "./workspace"

rollback, branching और ट्रैजेक्टरी निर्यात सहित पूरे संदर्भ के लिए लाइव कोडिंग एजेंट देखें।

Rollback और चेकपॉइंट

कोडिंग एजेंट सेशन में Potato हर फ़ाइल बदलाव के बाद एक git कमिट बनाता है। इससे ये मुमकिन होते हैं:

  • किसी भी पुराने चेकपॉइंट पर एक क्लिक में rollback
  • शाखा बनाकर दोहराना — किसी भी चेकपॉइंट से दूसरा तरीक़ा आज़माएँ
  • समीक्षा के लिए हर फ़ाइल स्थिति का पूरा इतिहास

चेकपॉइंट हर सेशन के लिए एक अलग git शाखा के ज़रिए अपने आप सँभाले जाते हैं।

शाखा बनाती ट्रैजेक्टरी

जब कोई एनोटेटर पीछे लौटकर दूसरा तरीक़ा आज़माता है, तो Potato एक शाखा बनाती ट्रैजेक्टरी बनाता है। दोनों शाखाएँ आउटपुट में सुरक्षित रहती हैं, जिससे इनके लिए प्रशिक्षण डेटा बनता है:

  • प्रोसेस रिवॉर्ड मॉडल — शाखाओं के आर-पार प्रति-चरण शुद्धता लेबल
  • प्रेफ़रेंस लर्निंग — किस शाखा से बेहतर नतीजे मिले
  • कोड समीक्षा डेटासेट — अलग-अलग तरीक़ों में कोड गुणवत्ता की तुलना

आगे पढ़ें

कार्यान्वयन के विवरण के लिए स्रोत दस्तावेज़ देखें।