valyu-best-practices by valyuai/skills
npx skills add https://github.com/valyuai/skills --skill valyu-best-practices本技能提供了使用 Valyu API 执行搜索、内容提取、AI 驱动答案和深度研究任务的指南。
使用此决策树选择适当的 Valyu API:
What do you need?
├─ Find information across multiple sources
│ └─ Use Search API
│
├─ Extract content from specific URLs
│ └─ Use Contents API
│
├─ Get an AI-synthesized answer with citations
│ └─ Use Answer API
│
├─ Generate a comprehensive research report
│ └─ Use DeepResearch API
│
└─ Discover available data sources
└─ Use Datasources API
关键:编写使用 Valyu API 的代码时,必须使用官方 SDK 库。切勿直接向 Valyu API 端点发起原始的 HTTP/fetch 调用。
valyu-jsnpm install valyu-js
# or
pnpm add valyu-js
import { Valyu } from 'valyu-js';
const valyu = new Valyu(process.env.VALYU_API_KEY);
// Now use valyu.search(), valyu.contents(), valyu.answer(), valyu.deepResearch
valyu广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
pip install valyu
# or
uv add valyu
from valyu import Valyu
valyu = Valyu(api_key=os.environ.get("VALYU_API_KEY"))
# Now use valyu.search(), valyu.contents(), valyu.answer(), valyu.deep_research
// DON'T make raw fetch calls
const response = await fetch('https://api.valyu.ai/v1/search', {
method: 'POST',
headers: {
'x-api-key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({ query: '...' })
});
// DO use the SDK
import { Valyu } from 'valyu-js';
const valyu = new Valyu(process.env.VALYU_API_KEY);
const response = await valyu.search({ query: '...' });
用途: 在网页、学术、医疗、交通、金融、新闻和专有来源中查找信息。
const response = await valyu.search({
query: "transformer architecture attention mechanism 2024",
searchType: "all",
maxNumResults: 10
});
| 类型 | 用于 |
|---|---|
all | 所有内容 - 网页、学术、金融、专有 |
web | 仅通用互联网内容 |
proprietary | 授权的学术论文和研究 |
news | 新闻文章和时事 |
| 参数 (TS/JS) | 参数 (Python) | 用途 | 示例 |
|---|---|---|---|
query | query | 搜索查询(少于 400 字符) | "CRISPR gene editing 2024" |
searchType | search_type | 来源范围 | "all", "web", "proprietary", "news" |
maxNumResults | max_num_results | 结果数量 (1-20) | 10 |
includedSources | included_sources | 限制为特定来源 | ["valyu/valyu-arxiv", "valyu/valyu-pubmed"] |
startDate / endDate | start_date / end_date | 日期过滤 | "2024-01-01" |
relevanceThreshold | relevance_threshold | 最小相关性 (0-1) | 0.7 |
学术研究:
await valyu.search({
query: "CRISPR therapeutic applications clinical trials",
searchType: "proprietary",
includedSources: ["valyu/valyu-arxiv", "valyu/valyu-pubmed", "valyu/valyu-biorxiv"],
startDate: "2024-01-01"
});
财务分析:
await valyu.search({
query: "Apple revenue Q4 2024 earnings",
searchType: "all",
includedSources: ["valyu/valyu-sec-filings", "valyu/valyu-earnings-US"]
});
新闻监测:
await valyu.search({
query: "AI regulation EU",
searchType: "news",
startDate: "2024-06-01",
countryCode: "EU"
});
有关详细模式,请参阅:
用途: 从网页中提取干净、结构化的内容,并针对 LLM 处理进行优化。
const response = await valyu.contents({
urls: ["https://example.com/article"]
});
const response = await valyu.contents({
urls: ["https://arxiv.org/abs/2401.12345"],
summary: "Extract key findings in 3 bullet points"
});
const response = await valyu.contents({
urls: ["https://example.com/product"],
summary: {
type: "object",
properties: {
product_name: { type: "string" },
price: { type: "number" },
features: { type: "array", items: { type: "string" } }
},
required: ["product_name", "price"]
}
});
| 参数 (TS/JS) | 参数 (Python) | 用途 | 示例 |
|---|---|---|---|
urls | urls | 要处理的 URL (1-10) | ["https://example.com"] |
responseLength | response_length | 内容长度 | "short", "medium", "large", "max" |
extractEffort | extract_effort | 提取质量 | "normal", "high", "auto" |
summary | summary | AI 摘要生成 | true, "instructions", 或 JSON 模式 |
screenshot | screenshot | 捕获屏幕截图 | true |
有关详细模式,请参阅:
用途: 获取基于实时搜索结果、带有引用的 AI 驱动答案。
const response = await valyu.answer({
query: "What are the latest developments in quantum computing?"
});
const response = await valyu.answer({
query: "Current Bitcoin price and 24h change",
fastMode: true
});
const response = await valyu.answer({
query: "Compare React and Vue for enterprise applications",
systemInstructions: "Provide a balanced comparison with pros and cons. Format as a comparison table."
});
const stream = await valyu.answer({
query: "Explain transformer architecture",
streaming: true
});
for await (const chunk of stream) {
// Handle: search_results, content, metadata, done, error
console.log(chunk);
}
const response = await valyu.answer({
query: "Apple Q4 2024 financial highlights",
structuredOutput: {
type: "object",
properties: {
revenue: { type: "string" },
growthRate: { type: "string" },
keyHighlights: { type: "array", items: { type: "string" } }
}
}
});
| 参数 (TS/JS) | 参数 (Python) | 用途 | 示例 |
|---|---|---|---|
query | query | 要回答的问题 | "What is quantum computing?" |
fastMode | fast_mode | 更低延迟 | true |
systemInstructions | system_instructions | AI 指令 | "Be concise" |
structuredOutput | structured_output | JSON 模式 | {type: "object", ...} |
streaming | streaming | 启用 SSE 流式传输 | true |
dataMaxPrice | data_max_price | 美元限制 | 1.0 |
有关详细模式,请参阅:
用途: 生成包含详细分析和引用的全面研究报告。
| 模式 | 持续时间 | 最适合 |
|---|---|---|
fast | ~5 分钟 | 快速查找、简单问题 |
standard | ~10-20 分钟 | 平衡的研究(最常见) |
heavy | ~90 分钟 | 全面分析、复杂主题 |
const task = await valyu.deepResearch.create({
query: "AI chip market competitive landscape 2024",
model: "standard"
});
// Returns: { deepresearch_id: "abc123", status: "queued" }
const status = await valyu.deepResearch.getStatus(task.deepresearch_id);
// status: "queued" | "running" | "completed" | "failed" | "cancelled"
if (status.status === "completed") {
console.log(status.output); // Markdown report
console.log(status.sources); // Cited sources
console.log(status.pdf_url); // PDF download link
}
| 参数 (TS/JS) | 参数 (Python) | 用途 | 示例 |
|---|---|---|---|
query | query | 研究问题 | "AI market trends 2024" |
model | model | 研究深度 | "fast", "standard", "heavy" |
outputFormat | output_format | 报告格式 | "markdown", "pdf" |
includedSources | included_sources | 来源过滤 | ["valyu/valyu-arxiv", "techcrunch.com"] |
startDate / endDate | start_date / end_date | 日期范围 | "2024-01-01" |
有关详细模式,请参阅:
| 元素 | 描述 | 示例 |
|---|---|---|
| 意图 | 你需要什么 | "最新进展" vs "概述" |
| 领域 | 主题术语 | "transformer architecture" |
| 约束 | 过滤器 | "2024", "peer-reviewed" |
| 来源类型 | 在哪里查找 | 学术论文、SEC 文件 |
BAD: "I want to know about AI"
GOOD: "transformer attention mechanism survey 2024"
BAD: "Apple financial information"
GOOD: "Apple revenue growth Q4 2024 earnings SEC filing"
BAD: "gene editing research"
GOOD: "CRISPR off-target effects therapeutic applications 2024"
# Don't do this
"Tesla stock performance, new products, and Elon Musk statements"
# Do this instead
Query 1: "Tesla stock performance Q4 2024"
Query 2: "Tesla Cybertruck production updates 2024"
Query 3: "Tesla FSD autonomous driving progress"
使用 includedSources 获取领域权威来源: 金融研究集合。可包含的一些来源:
valyu/valyu-sec-filings - SEC 监管文件
valyu/valyu-stocks - 股票市场数据
valyu/valyu-earnings-US - 财报
reuters.com - 金融新闻
bloomberg.com - 市场分析 医学研究集合。可包含的一些来源:
valyu/valyu-pubmed - 医学文献
valyu/valyu-clinical-trials - 临床试验数据
valyu/valyu-drug-labels - FDA 药品信息
nejm.org - 新英格兰医学杂志
thelancet.com - 柳叶刀 技术文档集合。可包含的一些来源:
docs.aws.amazon.com - AWS 文档
cloud.google.com/docs - Google Cloud 文档
learn.microsoft.com - Microsoft 文档
kubernetes.io/docs - Kubernetes 文档
developer.mozilla.org - MDN Web 文档
// Academic includedSources: ["valyu/valyu-arxiv", "valyu/valyu-pubmed", "nature"]
// Financial includedSources: ["valyu/valyu-sec-filings", "bloomberg.com", "reuters.com"]
// Tech news includedSources: ["techcrunch.com", "theverge.com", "arstechnica.com"]
完整的提示指南,请参阅 references/prompting.md。
// 1. Quick search to find sources
const searchResults = await valyu.search({
query: "CRISPR therapeutic applications",
searchType: "proprietary",
maxNumResults: 20
});
// 2. Extract key content from top results
const contents = await valyu.contents({
urls: searchResults.results.slice(0, 3).map(r => r.url),
summary: "Extract key findings"
});
// 3. Deep analysis for comprehensive report
const research = await valyu.deepResearch.create({
query: "CRISPR therapeutic applications comprehensive review",
model: "heavy"
});
// 1. Get SEC filings
const filings = await valyu.search({
query: "Apple 10-K 2024",
includedSources: ["valyu/valyu-sec-filings"]
});
// 2. Quick synthesis
const summary = await valyu.answer({
query: "Apple Q4 2024 financial highlights",
fastMode: true
});
// 3. Structured extraction
const metrics = await valyu.answer({
query: "Apple financial metrics 2024",
structuredOutput: {
type: "object",
properties: {
revenue: { type: "string" },
netIncome: { type: "string" },
growthRate: { type: "string" }
}
}
});
Valyu 提供对 25+ 个专业数据集的访问:
| 类别 | 示例 |
|---|---|
| 学术 | arXiv (250万+ 论文), PubMed (3700万+), bioRxiv, medRxiv |
| 金融 | SEC 文件, 财报电话会议记录, 股票数据, 加密货币 |
| 医疗保健 | 临床试验, DailyMed, PubChem, 药品标签, ChEMBL, DrugBank, Open Target, WHO ICD |
| 经济 | FRED, BLS, 世界银行, 美国财政部, Destatis |
| 预测 | Polymarket, Kalshi |
| 专利 | 美国专利数据库 |
| 交通 | 英国铁路, 船舶追踪 |
完整的数据源参考,请参阅 references/datasources.md。
完整的 API 文档,包括所有参数、响应结构和错误代码,请参阅 references/api-guide.md。
特定平台的集成文档:
每周安装次数
653
代码仓库
GitHub 星标数
12
首次出现
Jan 21, 2026
安全审计
安装于
cursor602
codex599
opencode598
gemini-cli596
github-copilot594
amp589
This skill provides instructions for using the Valyu API to perform search, content extraction, AI-powered answers, and deep research tasks.
Use this decision tree to select the appropriate Valyu API:
What do you need?
├─ Find information across multiple sources
│ └─ Use Search API
│
├─ Extract content from specific URLs
│ └─ Use Contents API
│
├─ Get an AI-synthesized answer with citations
│ └─ Use Answer API
│
├─ Generate a comprehensive research report
│ └─ Use DeepResearch API
│
└─ Discover available data sources
└─ Use Datasources API
CRITICAL: When writing code that uses the Valyu API, you MUST use the official SDK libraries. NEVER make raw HTTP/fetch calls to the Valyu API endpoints.
valyu-jsnpm install valyu-js
# or
pnpm add valyu-js
import { Valyu } from 'valyu-js';
const valyu = new Valyu(process.env.VALYU_API_KEY);
// Now use valyu.search(), valyu.contents(), valyu.answer(), valyu.deepResearch
valyupip install valyu
# or
uv add valyu
from valyu import Valyu
valyu = Valyu(api_key=os.environ.get("VALYU_API_KEY"))
# Now use valyu.search(), valyu.contents(), valyu.answer(), valyu.deep_research
// DON'T make raw fetch calls
const response = await fetch('https://api.valyu.ai/v1/search', {
method: 'POST',
headers: {
'x-api-key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({ query: '...' })
});
// DO use the SDK
import { Valyu } from 'valyu-js';
const valyu = new Valyu(process.env.VALYU_API_KEY);
const response = await valyu.search({ query: '...' });
Purpose: Find information across web, academic, medical, transportation, financial, news, and proprietary sources.
const response = await valyu.search({
query: "transformer architecture attention mechanism 2024",
searchType: "all",
maxNumResults: 10
});
| Type | Use For |
|---|---|
all | Everything - web, academic, financial, proprietary |
web | General internet content only |
proprietary | Licensed academic papers and research |
news | News articles and current events |
| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|---|---|---|---|
query | query | Search query (under 400 chars) | "CRISPR gene editing 2024" |
searchType | search_type | Source scope | "all", "web", , |
Academic Research:
await valyu.search({
query: "CRISPR therapeutic applications clinical trials",
searchType: "proprietary",
includedSources: ["valyu/valyu-arxiv", "valyu/valyu-pubmed", "valyu/valyu-biorxiv"],
startDate: "2024-01-01"
});
Financial Analysis:
await valyu.search({
query: "Apple revenue Q4 2024 earnings",
searchType: "all",
includedSources: ["valyu/valyu-sec-filings", "valyu/valyu-earnings-US"]
});
News Monitoring:
await valyu.search({
query: "AI regulation EU",
searchType: "news",
startDate: "2024-06-01",
countryCode: "EU"
});
For detailed patterns, see:
Purpose: Extract clean, structured content from web pages optimized for LLM processing.
const response = await valyu.contents({
urls: ["https://example.com/article"]
});
const response = await valyu.contents({
urls: ["https://arxiv.org/abs/2401.12345"],
summary: "Extract key findings in 3 bullet points"
});
const response = await valyu.contents({
urls: ["https://example.com/product"],
summary: {
type: "object",
properties: {
product_name: { type: "string" },
price: { type: "number" },
features: { type: "array", items: { type: "string" } }
},
required: ["product_name", "price"]
}
});
| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|---|---|---|---|
urls | urls | URLs to process (1-10) | ["https://example.com"] |
responseLength | response_length | Content length | "short", "medium", , |
For detailed patterns, see:
Purpose: Get AI-powered answers grounded in real-time search results with citations.
const response = await valyu.answer({
query: "What are the latest developments in quantum computing?"
});
const response = await valyu.answer({
query: "Current Bitcoin price and 24h change",
fastMode: true
});
const response = await valyu.answer({
query: "Compare React and Vue for enterprise applications",
systemInstructions: "Provide a balanced comparison with pros and cons. Format as a comparison table."
});
const stream = await valyu.answer({
query: "Explain transformer architecture",
streaming: true
});
for await (const chunk of stream) {
// Handle: search_results, content, metadata, done, error
console.log(chunk);
}
const response = await valyu.answer({
query: "Apple Q4 2024 financial highlights",
structuredOutput: {
type: "object",
properties: {
revenue: { type: "string" },
growthRate: { type: "string" },
keyHighlights: { type: "array", items: { type: "string" } }
}
}
});
| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|---|---|---|---|
query | query | Question to answer | "What is quantum computing?" |
fastMode | fast_mode | Lower latency | true |
systemInstructions |
For detailed patterns, see:
Purpose: Generate comprehensive research reports with detailed analysis and citations.
| Mode | Duration | Best For |
|---|---|---|
fast | ~5 minutes | Quick lookups, simple questions |
standard | ~10-20 minutes | Balanced research (most common) |
heavy | ~90 minutes | Comprehensive analysis, complex topics |
const task = await valyu.deepResearch.create({
query: "AI chip market competitive landscape 2024",
model: "standard"
});
// Returns: { deepresearch_id: "abc123", status: "queued" }
const status = await valyu.deepResearch.getStatus(task.deepresearch_id);
// status: "queued" | "running" | "completed" | "failed" | "cancelled"
if (status.status === "completed") {
console.log(status.output); // Markdown report
console.log(status.sources); // Cited sources
console.log(status.pdf_url); // PDF download link
}
| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|---|---|---|---|
query | query | Research question | "AI market trends 2024" |
model | model | Research depth | "fast", "standard", |
For detailed patterns, see:
| Element | Description | Example |
|---|---|---|
| Intent | What you need | "latest advancements" vs "overview" |
| Domain | Topic terminology | "transformer architecture" |
| Constraints | Filters | "2024", "peer-reviewed" |
| Source type | Where to look | academic papers, SEC filings |
BAD: "I want to know about AI"
GOOD: "transformer attention mechanism survey 2024"
BAD: "Apple financial information"
GOOD: "Apple revenue growth Q4 2024 earnings SEC filing"
BAD: "gene editing research"
GOOD: "CRISPR off-target effects therapeutic applications 2024"
# Don't do this
"Tesla stock performance, new products, and Elon Musk statements"
# Do this instead
Query 1: "Tesla stock performance Q4 2024"
Query 2: "Tesla Cybertruck production updates 2024"
Query 3: "Tesla FSD autonomous driving progress"
Use includedSources for domain authority: Financial Research Collection. Some sources to include:
valyu/valyu-sec-filings - SEC regulatory filings
valyu/valyu-stocks - Stock market data
valyu/valyu-earnings-US - Earnings reports
reuters.com - Financial news
bloomberg.com - Market analysis Medical Research Collection. Some sources to include:
valyu/valyu-pubmed - Medical literature
valyu/valyu-clinical-trials - Clinical trial data
valyu/valyu-drug-labels - FDA drug information
For complete prompting guide, see references/prompting.md.
// 1. Quick search to find sources
const searchResults = await valyu.search({
query: "CRISPR therapeutic applications",
searchType: "proprietary",
maxNumResults: 20
});
// 2. Extract key content from top results
const contents = await valyu.contents({
urls: searchResults.results.slice(0, 3).map(r => r.url),
summary: "Extract key findings"
});
// 3. Deep analysis for comprehensive report
const research = await valyu.deepResearch.create({
query: "CRISPR therapeutic applications comprehensive review",
model: "heavy"
});
// 1. Get SEC filings
const filings = await valyu.search({
query: "Apple 10-K 2024",
includedSources: ["valyu/valyu-sec-filings"]
});
// 2. Quick synthesis
const summary = await valyu.answer({
query: "Apple Q4 2024 financial highlights",
fastMode: true
});
// 3. Structured extraction
const metrics = await valyu.answer({
query: "Apple financial metrics 2024",
structuredOutput: {
type: "object",
properties: {
revenue: { type: "string" },
netIncome: { type: "string" },
growthRate: { type: "string" }
}
}
});
Valyu provides access to 25+ specialized datasets:
| Category | Examples |
|---|---|
| Academic | arXiv (2.5M+ papers), PubMed (37M+), bioRxiv, medRxiv |
| Financial | SEC filings, earnings transcripts, stock data, crypto |
| Healthcare | Clinical trials, DailyMed, PubChem, drug labels, ChEMBL, DrugBank, Open Target, WHO ICD |
| Economic | FRED, BLS, World Bank, US Treasury, Destatis |
| Predictions | Polymarket, Kalshi |
| Patents | US patent database |
| Transportation | UK Rail, Ship Tracking |
For complete datasource reference, see references/datasources.md.
For complete API documentation including all parameters, response structures, and error codes, see references/api-guide.md.
Platform-specific integration documentation:
Weekly Installs
653
Repository
GitHub Stars
12
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
cursor602
codex599
opencode598
gemini-cli596
github-copilot594
amp589
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
41,400 周安装
"proprietary""news"maxNumResults | max_num_results | Number of results (1-20) | 10 |
includedSources | included_sources | Limit to specific sources | ["valyu/valyu-arxiv", "valyu/valyu-pubmed"] |
startDate / endDate | start_date / end_date | Date filtering | "2024-01-01" |
relevanceThreshold | relevance_threshold | Minimum relevance (0-1) | 0.7 |
"large""max"extractEffort | extract_effort | Extraction quality | "normal", "high", "auto" |
summary | summary | AI summarization | true, "instructions", or JSON schema |
screenshot | screenshot | Capture screenshots | true |
system_instructions |
| AI directives |
"Be concise" |
structuredOutput | structured_output | JSON schema | {type: "object", ...} |
streaming | streaming | Enable SSE streaming | true |
dataMaxPrice | data_max_price | Dollar limit | 1.0 |
"heavy"outputFormat | output_format | Report format | "markdown", "pdf" |
includedSources | included_sources | Source filtering | ["valyu/valyu-arxiv", "techcrunch.com"] |
startDate / endDate | start_date / end_date | Date range | "2024-01-01" |
nejm.org - New England Journal of Medicine
thelancet.com - The Lancet Tech Documentation Collection. Some sources to include:
docs.aws.amazon.com - AWS documentation
cloud.google.com/docs - Google Cloud docs
learn.microsoft.com - Microsoft docs
kubernetes.io/docs - Kubernetes docs
developer.mozilla.org - MDN Web Docs
// Academic includedSources: ["valyu/valyu-arxiv", "valyu/valyu-pubmed", "nature"]
// Financial includedSources: ["valyu/valyu-sec-filings", "bloomberg.com", "reuters.com"]
// Tech news includedSources: ["techcrunch.com", "theverge.com", "arstechnica.com"]