openevidence-hello-world
Create a minimal working OpenEvidence clinical query example. Use when starting a new OpenEvidence integration, testing your setup, or learning basic clinical query patterns. Trigger with phrases like "openevidence hello world", "openevidence example", "openevidence quick start", "first clinical query".
- License 许可
- MIT
- 最近更新
- 2026-05-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- openevidence-hello-world
- author
- Jeremy Longshore <jeremy@intentsolutions.io>
- license
- MIT
- version
- 1.0.0
- description
- Create a minimal working OpenEvidence clinical query example. Use when starting a new OpenEvidence integration, testing your setup, or learning basic clinical query patterns. Trigger with phrases like "openevidence hello world", "openevidence example", "openevidence quick start", "first clinical query".
- allowed-tools
- Read, Write, Edit
- compatible-with
- claude-code, codex, openclaw
03 SKILL.md 正文
OpenEvidence Hello World
Overview
Minimal working example demonstrating core OpenEvidence clinical query functionality.
Prerequisites
- Completed
openevidence-install-authsetup - Valid API credentials configured
- Development environment ready
Instructions
Step 1: Create Entry File
// src/openevidence-demo.ts
import { OpenEvidenceClient } from '@openevidence/sdk';
const client = new OpenEvidenceClient({
apiKey: process.env.OPENEVIDENCE_API_KEY,
orgId: process.env.OPENEVIDENCE_ORG_ID,
});
Step 2: Make Your First Clinical Query
async function firstClinicalQuery() {
// Simple clinical question
const response = await client.query({
question: "What are the first-line treatments for type 2 diabetes in adults?",
context: {
specialty: "internal-medicine",
urgency: "routine",
},
});
console.log('Answer:', response.answer);
console.log('Sources:', response.citations.map(c => c.source));
console.log('Confidence:', response.confidence);
}
firstClinicalQuery().catch(console.error);
Step 3: Run the Example
# With TypeScript
npx ts-node src/openevidence-demo.ts
# With Node.js (after compilation)
node dist/openevidence-demo.js
Output
- Working code file with OpenEvidence client initialization
- Successful API response with evidence-based answer
- Console output showing:
Answer: First-line treatment for type 2 diabetes in adults typically includes...
Sources: ["NEJM 2024", "ADA Standards of Care 2025", "JAMA Internal Medicine"] # 2024: 2025 year
Confidence: 0.95
Response Structure
interface ClinicalQueryResponse {
answer: string; // Evidence-based clinical answer
citations: Citation[]; // Peer-reviewed sources
confidence: number; // 0-1 confidence score
lastUpdated: string; // When evidence was last reviewed
disclaimer: string; // Clinical use disclaimer
deepConsultAvailable: boolean; // Whether DeepConsult can provide more detail
}
interface Citation {
source: string; // Journal/guideline name
title: string; // Article title
authors: string[]; // Author list
year: number; // Publication year
doi?: string; // DOI if available
url?: string; // Link to source
}
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Import Error | SDK not installed | Verify with npm list @openevidence/sdk |
| Auth Error | Invalid credentials | Check environment variables are set |
| Timeout | Complex query or network issues | Increase timeout or retry |
| Rate Limit | Too many requests | Wait and retry with exponential backoff |
| Invalid Query | Question not clinical | Ensure query is medically relevant |
Examples
TypeScript Example with Error Handling
import { OpenEvidenceClient, OpenEvidenceError } from '@openevidence/sdk';
const client = new OpenEvidenceClient({
apiKey: process.env.OPENEVIDENCE_API_KEY,
orgId: process.env.OPENEVIDENCE_ORG_ID,
});
async function queryClinicalEvidence(question: string) {
try {
const response = await client.query({
question,
context: {
specialty: "family-medicine",
urgency: "routine",
},
options: {
maxCitations: 5,
includeGuidelines: true,
},
});
return {
answer: response.answer,
sources: response.citations,
confidence: response.confidence,
};
} catch (error) {
if (error instanceof OpenEvidenceError) {
console.error(`OpenEvidence Error [${error.code}]:`, error.message);
}
throw error;
}
}
// Example usage
queryClinicalEvidence(
"What is the recommended antibiotic for community-acquired pneumonia?"
).then(result => {
console.log('Clinical Answer:', result.answer);
console.log('Evidence Sources:', result.sources.length);
});
Python Example
from openevidence import OpenEvidenceClient, OpenEvidenceError
client = OpenEvidenceClient()
def query_clinical_evidence(question: str) -> dict:
try:
response = client.query(
question=question,
context={
"specialty": "emergency-medicine",
"urgency": "urgent"
}
)
return {
"answer": response.answer,
"sources": [c.source for c in response.citations],
"confidence": response.confidence
}
except OpenEvidenceError as e:
print(f"Error [{e.code}]: {e.message}")
raise
# Example usage
result = query_clinical_evidence(
"What are the contraindications for tPA in acute ischemic stroke?"
)
print(f"Answer: {result['answer']}")
Resources
Next Steps
Proceed to openevidence-local-dev-loop for development workflow setup.
04 同仓库更多 Skills
zustand-store-ts
Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.
zustand-store-creator
Zustand Store Creator - Auto-activating skill for Frontend Development. Triggers on: zustand store creator, zustand store creator Part of the Frontend Development skill category.
zero-trust-config-helper
Zero Trust Config Helper - Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category.
zapier-integration-helper
Zapier Integration Helper - Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category.
zai-cli
Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP. Use when user needs image/video analysis, OCR, UI-to-code conversion, error diagnosis, real-time web search, web page to markdown extraction, or GitHub code exploration. Trigger with phrases like "analyze this image", "search the web for", "read this page", "explore this repo", or "use zai". Requires Z_AI_API_KEY.
yt-research
Research competitor YouTube channels, niches, and trending topics for your content strategy. Use this skill whenever the user says "research channels", "analyze competitors", "find trending topics", "niche analysis", "competitive research", "what are other creators doing", "scrape YouTube channels", or wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.