Imported from chopra-mayank/Implementing-skills-in-langchain (
docs-faithful-no-sandbox/skills/json-extractor/SKILL.md). Install upstream withnpx skills add chopra-mayank/Implementing-skills-in-langchain --skill json-extractor. Copyright stays with the author.
JSON Extractor
Overview
Pull specific structured fields out of unstructured text and return them as a JSON object that matches a fixed schema.
Steps
- Read the user's text.
- Locate the following fields if present:
name— full name of the sender (string or null)email— email address (string or null)phone— phone number with any country code (string or null)intent— one of:question,complaint,request,feedback, or nullurgency— one of:low,medium,high, or null
- For any field you cannot find with high confidence, return null.
- Return ONLY a JSON object. No prose, no explanation.
Expected Output Format
{
"name": "...",
"email": "...",
"phone": "...",
"intent": "...",
"urgency": "..."
}
Rules
- Never guess a value. If unsure, return null.
- Output must be valid JSON parseable by Python's
json.loads. - Do not wrap the JSON in markdown code fences.
- Do not include comments or trailing commas.