124 lines
5.0 KiB
Python
124 lines
5.0 KiB
Python
"""
|
|
JSON-схемы для инструментов research-agent плагина.
|
|
|
|
Схемы = то, что LLM видит как описание инструмента.
|
|
Строго по спецификации OpenAI function calling.
|
|
"""
|
|
|
|
DEEP_RESEARCH_SCHEMA = {
|
|
"type": "function",
|
|
"function": {
|
|
"name": "deep_research",
|
|
"description": (
|
|
"Deep multi-step research on a topic — Perplexity Deep Research style. "
|
|
"Searches the web in 2 rounds, reads full article texts, identifies "
|
|
"knowledge gaps, follows up, and synthesizes a structured report with "
|
|
"inline citations [N] and full source URLs. "
|
|
"Use this when the user needs an in-depth analytical report on a topic, "
|
|
"market research, competitive analysis, or comprehensive literature review. "
|
|
"Takes 2-5 minutes. Returns a markdown report with Overview, Trends, Details, "
|
|
"and Sources sections."
|
|
),
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"query": {
|
|
"type": "string",
|
|
"description": "The research topic or question. Be specific — e.g. 'AI coding agents market 2026' not just 'AI agents'.",
|
|
},
|
|
"lang": {
|
|
"type": "string",
|
|
"enum": ["ru", "en"],
|
|
"default": "ru",
|
|
"description": "Language for search queries and report: 'ru' for Russian, 'en' for English.",
|
|
},
|
|
},
|
|
"required": ["query"],
|
|
},
|
|
},
|
|
}
|
|
|
|
PERPLEXITY_SEARCH_SCHEMA = {
|
|
"type": "function",
|
|
"function": {
|
|
"name": "perplexity_search",
|
|
"description": (
|
|
"Quick one-shot Perplexity-style search — searches the web, reads top articles, "
|
|
"and synthesizes a structured report with inline citations [N] and source URLs. "
|
|
"Use this for factual lookups, quick overviews, trend checks, or when the user "
|
|
"asks 'what is X', 'how does Y work', 'latest news about Z'. "
|
|
"Takes 30-90 seconds. Returns a markdown report with Overview, Trends, and Sources."
|
|
),
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"query": {
|
|
"type": "string",
|
|
"description": "The search query. Be specific and keyword-rich.",
|
|
},
|
|
"category": {
|
|
"type": "string",
|
|
"enum": ["general", "news", "it", "science"],
|
|
"default": "general",
|
|
"description": "SearXNG search category: 'general' (default), 'news' for current events, 'it' for tech, 'science' for academic.",
|
|
},
|
|
"results": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 5,
|
|
"default": 3,
|
|
"description": "Number of articles to fetch and read in full (1-5, default 3).",
|
|
},
|
|
},
|
|
"required": ["query"],
|
|
},
|
|
},
|
|
}
|
|
|
|
YOUTUBE_ANALYZE_SCHEMA = {
|
|
"type": "function",
|
|
"function": {
|
|
"name": "youtube_analyze",
|
|
"description": (
|
|
"Analyze YouTube videos — extract key points, timestamps, and quotes. "
|
|
"Two modes: (1) by URL — analyze a specific video; (2) by search — find "
|
|
"and analyze top video(s) on a topic. Can compare multiple videos. "
|
|
"Uses subtitles when available, falls back to Whisper transcription. "
|
|
"Takes 1-3 minutes. Returns a markdown report with timestamps [MM:SS], "
|
|
"key points, and quotes."
|
|
),
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string",
|
|
"description": "YouTube video URL to analyze. Mutually exclusive with 'search'.",
|
|
},
|
|
"search": {
|
|
"type": "string",
|
|
"description": "Search query to find and analyze videos on YouTube. Mutually exclusive with 'url'.",
|
|
},
|
|
"lang": {
|
|
"type": "string",
|
|
"enum": ["ru", "en"],
|
|
"default": "ru",
|
|
"description": "Preferred subtitle language: 'ru' for Russian, 'en' for English.",
|
|
},
|
|
"limit": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 5,
|
|
"default": 1,
|
|
"description": "Number of videos to analyze when using search mode (1-5, default 1).",
|
|
},
|
|
"compare": {
|
|
"type": "boolean",
|
|
"default": False,
|
|
"description": "If true and search mode, compare multiple videos side-by-side (requires limit >= 2).",
|
|
},
|
|
},
|
|
"required": [],
|
|
},
|
|
},
|
|
}
|