用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill langchain-1-error-handling命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | langchain-1-error-handling |
| description | Sub-skill of langchain: 1. Error Handling (+2). |
| version | 1.0.0 |
| category | ai-prompting |
| type | reference |
| scripts_exempt | true |
from langchain_core.runnables import RunnableConfig
from langchain_core.callbacks import CallbackManager
import logging
logger = logging.getLogger(__name__)
def safe_invoke(chain, input_data, max_retries=3):
"""Invoke chain with retry logic."""
for attempt in range(max_retries):
try:
return chain.invoke(input_data)
except Exception as e:
logger.warning(f"Attempt {attempt + 1} failed: {e}")
if attempt == max_retries - 1:
raise
time.sleep(2 ** attempt) # Exponential backoff
from pathlib import Path
import yaml
def load_prompt_template(version: str = "v1"):
"""Load versioned prompt template."""
prompt_path = Path(f"prompts/{version}.yaml")
with open(prompt_path) as f:
config = yaml.safe_load(f)
return ChatPromptTemplate.from_template(config["template"])
from langchain_community.callbacks import get_openai_callback
def track_costs(chain, input_data):
"""Track API costs for chain invocation."""
with get_openai_callback() as cb:
result = chain.invoke(input_data)
print(f"Total Tokens: {cb.total_tokens}")
print(f"Prompt Tokens: {cb.prompt_tokens}")
print(f"Completion Tokens: {cb.completion_tokens}")
print(f"Total Cost: ${cb.total_cost:.4f}")
return result, cb
Write outbound email and external messages in Vamsee Achanta's voice — a subtle offer to help, never bold or rash claims. Load before drafting ANY email, LinkedIn/Collide reply, proposal note, or outreach sent under his name.
Save/publish analysis or computation results from ANY ecosystem repo to Hugging Face as a queryable, viewer-renderable dataset. Use when the user wants to "save results to hugging face", "publish dataset to HF", "hugging face data saving", "save analysis results", "hf dataset", "make results queryable", or "render via datasets-server API". Reshapes nested results into flat parquet tables, writes a dataset card with a viewer `configs:` block and provenance, applies license/public-vs-private routing, enforces a domain data-quality gate (faithful-to-source != correct), publishes to `aceengineer/<repo>-<projection>`, and verifies via the datasets-server API.
Clone, create, fork, configure, and manage GitHub repositories. Manage remotes, secrets, releases, and workflows. Works with gh CLI or falls back to git + GitHub REST API via curl.