惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
罗磊的独立博客
C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
B
Blog RSS Feed

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders
telnyx-code-examples/extract-structured-json-with-ai-pyth...
sona-coffee1 · 2026-06-26 · via Hacker News - Newest: "AI"
name extract-structured-json-with-ai
title Extract Structured JSON with AI
description Extract structured JSON from support tickets, emails, leads, or incident reports with Telnyx AI Inference.
language python
framework flask
telnyx_products

AI Inference

Extract structured JSON from support tickets, emails, leads, or incident reports with Telnyx AI Inference.

Telnyx API Endpoints Used

Architecture

  Unstructured text
        |
        v
  Flask API validates request
        |
        v
  Telnyx AI Inference extracts JSON
        |
        v
  Structured JSON response

Environment Variables

Copy .env.example to .env and fill in:

Variable Type Example Required Description Where to get it
TELNYX_API_KEY string KEY0123456789ABCDEF yes Telnyx API v2 key Portal
AI_MODEL string moonshotai/Kimi-K2.6 no Telnyx AI Inference model name Models
HOST string 127.0.0.1 no Local server host -
PORT integer 5000 no Local server port -

Setup

git clone https://github.com/team-telnyx/telnyx-code-examples.git
cd telnyx-code-examples/extract-structured-json-with-ai-python
cp .env.example .env
pip install -r requirements.txt
python app.py

API Reference

POST /extract

Extract structured data from text. If you do not provide a schema, the app uses a default support-ticket schema.

curl -X POST http://localhost:5000/extract \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Account: Acme Health. Production verification jobs started failing after an API key rotation. Users cannot finish signup. Logs show 401 errors."
  }'

Response:

{
  "model": "moonshotai/Kimi-K2.6",
  "result": {
    "company": "Acme Health",
    "category": "authentication",
    "priority": "urgent",
    "summary": "Production verification jobs are failing after an API key rotation.",
    "affected_environment": "production",
    "affected_region": "unknown",
    "customer_impact": "Users cannot finish signup.",
    "error_codes": ["401"],
    "suspected_cause": "The new API key may be invalid or missing required permissions.",
    "requested_action": "Check API key configuration and permissions."
  }
}

GET /sample

Returns sample text and the default schema.

GET /health

Returns service status and configured model.

Troubleshooting

Issue Cause Fix
401 Unauthorized Invalid or missing Telnyx API key Verify TELNYX_API_KEY in .env
400 Bad Request Missing text or invalid schema Send a non-empty text string and a JSON object schema
502 Model response was not valid JSON The selected model did not return parseable JSON Retry with the default model or simplify the schema

Related Examples

Resources

Why Telnyx

Telnyx is an AI Communications Infrastructure platform - voice, messaging, SIP, AI, and IoT on one private, global network.