[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-promptslab--Promptify":3,"tool-promptslab--Promptify":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":80,"owner_twitter":75,"owner_website":81,"owner_url":82,"languages":83,"stars":96,"forks":97,"last_commit_at":98,"license":99,"difficulty_score":100,"env_os":101,"env_gpu":102,"env_ram":102,"env_deps":103,"category_tags":112,"github_topics":113,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":133,"updated_at":134,"faqs":135,"releases":166},2040,"promptslab\u002FPromptify","Promptify","Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research","Promptify 是一个专注于提示工程的开源 NLP 工具，帮助用户用简单的代码调用大语言模型（如 GPT、Claude、Llama 等）完成结构化任务，比如命名实体识别、文本分类、问答和自定义信息抽取。它不再需要手动编写复杂的提示词，而是通过预设的模块（如 NER、Classify、QA）和 Pydantic 数据结构，自动将模型输出转化为干净、可编程的格式，大幅提升开发效率。\n\n它解决了传统 LLM 应用中提示词混乱、输出格式不统一、评估困难等问题，让开发者能像使用 scikit-learn 一样轻松构建 LLM 驱动的 NLP 流程。无论是想快速验证想法的研究人员，还是希望稳定集成 AI 功能的开发者，都能从中受益。支持 OpenAI、Claude、Ollama 等多种模型，只需改一行代码即可切换后端，还内置评估指标和异步批量处理能力，适合生产级应用。\n\n特别的是，它允许你用任意 Pydantic 模型定义输出结构，让 AI 输出直接对接你的数据管道，无需额外解析。适合有 Python 基础的开发者和研究人员使用，普通用户也可通过 Colab 快速体验。","\u003Cdiv align=\"center\">\n\u003Cimg width=\"110px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpromptslab_Promptify_readme_5a890630515f.png\">\n\u003Ch1>Promptify\u003C\u002Fh1>\u003C\u002Fdiv>\n\u003C!-- \n\u003Ch2 align=\"center\">Promptify\u003C\u002Fh2> -->\n\n\u003Cp align=\"center\">\n  \u003Cp align=\"center\">Task-based NLP engine with Pydantic structured outputs, built-in evaluation, and LiteLLM as the universal LLM backend. Think \"scikit-learn for LLM-powered NLP\".\n\u003C\u002Fp>\n\u003C\u002Fp>\n\n \u003Ch4 align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify\u002Fblob\u002Fmain\u002FLICENSE\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-blue.svg\" alt=\"Promptify is released under the Apache 2.0 license.\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fpromptify\u002F\">\n    \u003Cimg src=\"https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FPromptify.svg\" alt=\"PyPI version\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"http:\u002F\u002Fmakeapullrequest.com\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPRs-welcome-brightgreen.svg?style=flat-square\" alt=\"http:\u002F\u002Fmakeapullrequest.com\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fm88xfYMbK6\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-Community-orange\" alt=\"Community\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"#\">\n    \u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"colab\" \u002F>\n  \u003C\u002Fa>\n\u003C\u002Fh4>\n\n\u003Cimg width=\"910px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpromptslab_Promptify_readme_36506d9d0fbf.png\">\n\n## Installation\n\n### With pip\n\nRequires Python 3.9+.\n\n```bash\npip install promptify\n```\n\nor\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify.git\n```\n\nFor evaluation metrics support:\n```bash\npip install promptify[eval]\n```\n\n## Quick Tour\n\n### 3-Line NER\n\n```python\nfrom promptify import NER\n\nner = NER(model=\"gpt-4o-mini\", domain=\"medical\")\nresult = ner(\"The patient is a 93-year-old female with a medical history of chronic right hip pain, osteoporosis, hypertension, depression, and chronic atrial fibrillation admitted for evaluation and management of severe nausea and vomiting and urinary tract infection\")\n```\n\n**Output:**\n```python\nNERResult(entities=[\n    Entity(text=\"93-year-old\", label=\"AGE\"),\n    Entity(text=\"chronic right hip pain\", label=\"CONDITION\"),\n    Entity(text=\"osteoporosis\", label=\"CONDITION\"),\n    Entity(text=\"hypertension\", label=\"CONDITION\"),\n    Entity(text=\"depression\", label=\"CONDITION\"),\n    Entity(text=\"chronic atrial fibrillation\", label=\"CONDITION\"),\n    Entity(text=\"severe nausea and vomiting\", label=\"SYMPTOM\"),\n    Entity(text=\"urinary tract infection\", label=\"CONDITION\"),\n])\n```\n\n### Classification\n\n```python\nfrom promptify import Classify\n\nclf = Classify(model=\"gpt-4o-mini\", labels=[\"positive\", \"negative\", \"neutral\"])\nresult = clf(\"Amazing product! Best purchase I've ever made.\")\n# Classification(label=\"positive\", confidence=0.95)\n```\n\n### Question Answering\n\n```python\nfrom promptify import QA\n\nqa = QA(model=\"gpt-4o-mini\")\nanswer = qa(\"Einstein was born in Ulm in 1879.\", question=\"Where was Einstein born?\")\n# Answer(answer=\"Ulm\", evidence=\"Einstein was born in Ulm\", confidence=0.98)\n```\n\n### Custom Task with Any Pydantic Schema\n\n```python\nfrom promptify import Task\nfrom pydantic import BaseModel\n\nclass MovieReview(BaseModel):\n    sentiment: str\n    rating: float\n    key_themes: list[str]\n\ntask = Task(model=\"gpt-4o\", output_schema=MovieReview, instruction=\"Analyze this movie review.\")\nreview = task(\"Nolan's best work. Stunning visuals but the plot drags.\")\n# MovieReview(sentiment=\"mostly positive\", rating=7.5, key_themes=[\"visuals\", \"pacing\"])\n```\n\n### Any Provider - Just Change the Model String\n\n```python\nner_openai = NER(model=\"gpt-4o-mini\")\nner_claude = NER(model=\"claude-sonnet-4-20250514\")\nner_local  = NER(model=\"ollama\u002Fllama3\")\n```\n\n### Batch Processing\n\n```python\nresults = ner.batch([\"text1\", \"text2\", \"text3\"], max_concurrent=10)\n```\n\n### Async Support\n\n```python\nresult = await ner.acall(\"Patient has diabetes\")\n```\n\n### Built-in Evaluation\n\n```python\nfrom promptify.eval import evaluate\n\nscores = evaluate(task=ner, dataset=labeled_data, metrics=[\"precision\", \"recall\", \"f1\"])\n# {\"precision\": 0.92, \"recall\": 0.88, \"f1\": 0.90}\n```\n\n## Features\n\n- **2-3 lines of code** for any NLP task -no training data required\n- **Pydantic structured outputs** -type-safe results, not raw strings\n- **Any LLM provider** via LiteLLM -OpenAI, Anthropic, Google, Ollama, Azure, and 100+ more\n- **Built-in tasks** -NER, Classification (binary\u002Fmulticlass\u002Fmultilabel), QA, Summarization, Relation Extraction, SQL Generation, and more\n- **Custom tasks** -bring your own Pydantic schema for any structured output\n- **Few-shot examples** -easily add examples to improve accuracy\n- **Domain specialization** -pass `domain=\"medical\"` or any domain for context-aware prompts\n- **Batch processing** -async concurrency under the hood for processing multiple texts\n- **Async support** -native `await` support with `acall()`\n- **Evaluation framework** -precision, recall, F1, accuracy, exact match, ROUGE metrics\n- **Safe parser** -fallback JSON completion for providers without native structured outputs (no `eval()`)\n- **Cost tracking** -built-in token usage and cost monitoring via `get_cost_summary()`\n\n### Supported NLP Tasks\n\n| Task | Class | Output Schema |\n|------|-------|---------------|\n| Named Entity Recognition | `NER` | `NERResult` (list of `Entity`) |\n| Binary Classification | `Classify` | `Classification` |\n| Multiclass Classification | `Classify` | `Classification` |\n| Multilabel Classification | `Classify(multi_label=True)` | `MultiLabelResult` |\n| Question Answering | `QA` | `Answer` |\n| Summarization | `Summarize` | `Summary` |\n| Relation Extraction | `ExtractRelations` | `ExtractionResult` |\n| Tabular Extraction | `ExtractTable` | `ExtractionResult` |\n| Question Generation | `GenerateQuestions` | list of `GeneratedQuestion` |\n| SQL Generation | `GenerateSQL` | `SQLQuery` |\n| Text Normalization | `NormalizeText` | normalized text |\n| Topic Modelling | `ExtractTopics` | list of topics |\n| Custom Task | `Task` | any Pydantic `BaseModel` |\n\n## Community\n\u003Cdiv align=\"center\">\nIf you are interested in Prompt-Engineering, LLMs, and NLP, please consider joining \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fm88xfYMbK6\">PromptsLab\u003C\u002Fa>\u003C\u002Fdiv>\n\u003Cdiv align=\"center\">\n\u003Cimg alt=\"Join us on Discord\" src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1069129502472556587?color=5865F2&logo=discord&logoColor=white\">\n\u003C\u002Fdiv>\n\n\n\n```\n\n@misc{Promptify2022,\n  title = {Promptify: Structured Output from LLMs},\n  author = {Pal, Ankit},\n  year = {2022},\n  howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify}},\n  note = {Prompt-Engineering components for NLP tasks in Python}\n}\n\n```\n\n## 💁 Contributing\n\nWe welcome any contributions to our open source project, including new features, improvements to infrastructure, and more comprehensive documentation. \nPlease see the [contributing guidelines](contribute.md)\n","\u003Cdiv align=\"center\">\n\u003Cimg width=\"110px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpromptslab_Promptify_readme_5a890630515f.png\">\n\u003Ch1>Promptify\u003C\u002Fh1>\u003C\u002Fdiv>\n\u003C!-- \n\u003Ch2 align=\"center\">Promptify\u003C\u002Fh2> -->\n\n\u003Cp align=\"center\">\n  \u003Cp align=\"center\">基于任务的NLP引擎，支持Pydantic结构化输出、内置评估功能，并以LiteLLM作为通用大模型后端。可将其视为“用于大模型驱动NLP的scikit-learn”。\n\u003C\u002Fp>\n\u003C\u002Fp>\n\n\u003Ch4 align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify\u002Fblob\u002Fmain\u002FLICENSE\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-blue.svg\" alt=\"Promptify在Apache 2.0许可下发布。\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fpromptify\u002F\">\n    \u003Cimg src=\"https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FPromptify.svg\" alt=\"PyPI版本\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"http:\u002F\u002Fmakeapullrequest.com\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPRs-welcome-brightgreen.svg?style=flat-square\" alt=\"http:\u002F\u002Fmakeapullrequest.com\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fm88xfYMbK6\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-Community-orange\" alt=\"社区\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"#\">\n    \u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"colab\" \u002F>\n  \u003C\u002Fa>\n\u003C\u002Fh4>\n\n\u003Cimg width=\"910px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpromptslab_Promptify_readme_36506d9d0fbf.png\">\n\n## 安装\n\n### 使用pip\n\n需要Python 3.9+。\n\n```bash\npip install promptify\n```\n\n或者\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify.git\n```\n\n若需评估指标支持：\n```bash\npip install promptify[eval]\n```\n\n## 快速入门\n\n### 三行代码实现命名实体识别\n\n```python\nfrom promptify import NER\n\nner = NER(model=\"gpt-4o-mini\", domain=\"medical\")\nresult = ner(\"该患者为93岁女性，有慢性右侧髋部疼痛、骨质疏松、高血压、抑郁症和慢性心房颤动病史，因严重恶心呕吐及尿路感染入院接受评估与治疗。\")\n```\n\n**输出：**\n```python\nNERResult(entities=[\n    Entity(text=\"93岁\", label=\"AGE\"),\n    Entity(text=\"慢性右侧髋部疼痛\", label=\"CONDITION\"),\n    Entity(text=\"骨质疏松\", label=\"CONDITION\"),\n    Entity(text=\"高血压\", label=\"CONDITION\"),\n    Entity(text=\"抑郁症\", label=\"CONDITION\"),\n    Entity(text=\"慢性心房颤动\", label=\"CONDITION\"),\n    Entity(text=\"严重恶心呕吐\", label=\"SYMPTOM\"),\n    Entity(text=\"尿路感染\", label=\"CONDITION\"),\n])\n```\n\n### 分类\n\n```python\nfrom promptify import Classify\n\nclf = Classify(model=\"gpt-4o-mini\", labels=[\"positive\", \"negative\", \"neutral\"])\nresult = clf(\"超棒的产品！我买过的最棒的购物体验。\")\n# Classification(label=\"positive\", confidence=0.95)\n```\n\n### 问答\n\n```python\nfrom promptify import QA\n\nqa = QA(model=\"gpt-4o-mini\")\nanswer = qa(\"爱因斯坦于1879年出生在乌尔姆。\", question=\"爱因斯坦出生在哪里？\")\n# Answer(answer=\"乌尔姆\", evidence=\"爱因斯坦出生于乌尔姆\", confidence=0.98)\n```\n\n### 自定义任务，使用任意Pydantic模式\n\n```python\nfrom promptify import Task\nfrom pydantic import BaseModel\n\nclass MovieReview(BaseModel):\n    sentiment: str\n    rating: float\n    key_themes: list[str]\n\ntask = Task(model=\"gpt-4o\", output_schema=MovieReview, instruction=\"分析这条影评。\")\nreview = task(\"诺兰的最佳作品。视觉效果惊艳，但剧情拖沓。\")\n# MovieReview(sentiment=\"大部分正面\", rating=7.5, key_themes=[\"视觉效果\", \"节奏\"])\n```\n\n### 任意提供商——只需更改模型字符串\n\n```python\nner_openai = NER(model=\"gpt-4o-mini\")\nner_claude = NER(model=\"claude-sonnet-4-20250514\")\nner_local  = NER(model=\"ollama\u002Fllama3\")\n```\n\n### 批量处理\n\n```python\nresults = ner.batch([\"文本1\", \"文本2\", \"文本3\"], max_concurrent=10)\n```\n\n### 异步支持\n\n```python\nresult = await ner.acall(\"患者患有糖尿病\")\n```\n\n### 内置评估\n\n```python\nfrom promptify.eval import evaluate\n\nscores = evaluate(task=ner, dataset=labeled_data, metrics=[\"precision\", \"recall\", \"f1\"])\n# {\"precision\": 0.92, \"recall\": 0.88, \"f1\": 0.90}\n```\n\n## 特性\n\n- **仅需2-3行代码**即可完成任何NLP任务——无需训练数据\n- **Pydantic结构化输出**——类型安全的结果，而非原始字符串\n- **任意大模型提供商**通过LiteLLM——OpenAI、Anthropic、Google、Ollama、Azure等100多种\n- **内置任务**——命名实体识别、二分类、多分类、多标签分类、问答、摘要、关系抽取、SQL生成等\n- **自定义任务**——可使用自己的Pydantic模式实现任意结构化输出\n- **少样本示例**——轻松添加示例以提升准确率\n- **领域专精**——传递`domain=\"medical\"`或其他领域以获得上下文感知提示\n- **批量处理**——后台异步并发处理多条文本\n- **异步支持**——原生`await`支持，配合`acall()`\n- **评估框架**——精确率、召回率、F1值、准确率、完全匹配、ROUGE指标\n- **安全解析器**——对于不支持原生结构化输出的提供商，提供JSON补全作为备选方案（无需`eval()`）\n- **成本追踪**——内置Token用量与成本监控，通过`get_cost_summary()`实现\n\n### 支持的NLP任务\n\n| 任务 | 类 | 输出模式 |\n|------|-------|---------------|\n| 命名实体识别 | `NER` | `NERResult`（实体列表） |\n| 二分类 | `Classify` | `Classification` |\n| 多分类 | `Classify` | `Classification` |\n| 多标签分类 | `Classify(multi_label=True)` | `MultiLabelResult` |\n| 问答 | `QA` | `Answer` |\n| 摘要 | `Summarize` | `Summary` |\n| 关系抽取 | `ExtractRelations` | `ExtractionResult` |\n| 表格抽取 | `ExtractTable` | `ExtractionResult` |\n| 问题生成 | `GenerateQuestions` | 问题列表 |\n| SQL生成 | `GenerateSQL` | `SQLQuery` |\n| 文本规范化 | `NormalizeText` | 规范化后的文本 |\n| 主题建模 | `ExtractTopics` | 主题列表 |\n| 自定义任务 | `Task` | 任意Pydantic `BaseModel` |\n\n## 社区\n\u003Cdiv align=\"center\">\n如果您对Prompt工程、大模型和NLP感兴趣，请考虑加入\u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fm88xfYMbK6\">PromptsLab\u003C\u002Fa>\u003C\u002Fdiv>\n\u003Cdiv align=\"center\">\n\u003Cimg alt=\"加入Discord\" src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1069129502472556587?color=5865F2&logo=discord&logoColor=white\">\n\u003C\u002Fdiv>\n\n\n\n```\n\n@misc{Promptify2022,\n  title = {Promptify: LLM结构化输出},\n  author = {帕尔，安基特},\n  year = {2022},\n  howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify}},\n  note = {用于Python中NLP任务的Prompt工程组件}\n}\n\n```\n\n## 💁 贡献\n\n我们欢迎任何对开源项目的贡献，包括新功能、基础设施改进以及更全面的文档。\n请查看[贡献指南](contribute.md)","# Promptify 快速上手指南\n\n## 环境准备\n\n- Python 3.9 或更高版本  \n- 推荐使用国内镜像源加速安装：`pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`\n\n## 安装步骤\n\n```bash\npip install promptify\n```\n\n如需评估指标支持（如 F1、召回率等）：\n\n```bash\npip install promptify[eval]\n```\n\n或从 GitHub 直接安装最新版：\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify.git\n```\n\n## 基本使用\n\n### 命名实体识别（NER）——3行代码完成\n\n```python\nfrom promptify import NER\n\nner = NER(model=\"gpt-4o-mini\", domain=\"medical\")\nresult = ner(\"The patient is a 93-year-old female with chronic atrial fibrillation.\")\n```\n\n**输出示例：**\n```python\nNERResult(entities=[\n    Entity(text=\"93-year-old\", label=\"AGE\"),\n    Entity(text=\"chronic atrial fibrillation\", label=\"CONDITION\"),\n])\n```\n\n### 文本分类\n\n```python\nfrom promptify import Classify\n\nclf = Classify(model=\"gpt-4o-mini\", labels=[\"positive\", \"negative\", \"neutral\"])\nresult = clf(\"Amazing product! Best purchase I've ever made.\")\n# Classification(label=\"positive\", confidence=0.95)\n```\n\n### 自定义结构化输出（Pydantic）\n\n```python\nfrom promptify import Task\nfrom pydantic import BaseModel\n\nclass MovieReview(BaseModel):\n    sentiment: str\n    rating: float\n    key_themes: list[str]\n\ntask = Task(model=\"gpt-4o\", output_schema=MovieReview, instruction=\"Analyze this movie review.\")\nreview = task(\"Nolan's best work. Stunning visuals but the plot drags.\")\n# MovieReview(sentiment=\"mostly positive\", rating=7.5, key_themes=[\"visuals\", \"pacing\"])\n```\n\n### 支持任意模型提供商（无需改代码）\n\n```python\nner_openai = NER(model=\"gpt-4o-mini\")        # OpenAI\nner_claude = NER(model=\"claude-sonnet-4-20250514\")  # Anthropic\nner_local  = NER(model=\"ollama\u002Fllama3\")       # 本地 Ollama\n```\n\n> 所有任务均支持异步调用：`await ner.acall(\"text\")` 和批量处理：`ner.batch([text1, text2], max_concurrent=10)`","某医疗科技公司正在开发一款智能病历分析系统，需从医生录入的自由文本中自动提取患者病史、症状和诊断信息，供临床决策支持使用。\n\n### 没有 Promptify 时\n- 每次新增实体类型（如“用药史”“过敏原”）都需要手动重写提示词，反复调试，耗时数天\n- 不同模型（OpenAI、Claude、本地Llama）的接口不统一，切换模型需重构整个调用逻辑\n- 输出格式混乱，需额外写解析器将JSON字符串转为结构化数据，容易因模型输出不稳定导致崩溃\n- 缺乏评估机制，无法量化提取准确率，团队对结果可信度心中没底\n- 批量处理病历时需自行实现并发控制，代码冗长且易出错，处理1000份病历需手动分批运行\n\n### 使用 Promptify 后\n- 仅需定义一个Pydantic模型，如`PatientHistory`，即可一键生成结构化提取任务，新增字段只需修改类定义，5分钟完成\n- 通过简单修改`model=\"gpt-4o-mini\"`为`model=\"claude-sonnet-4-20250514\"`或`model=\"ollama\u002Fllama3\"`，无缝切换后端，无需改业务逻辑\n- 自动输出标准化的`NERResult`对象，直接用于下游系统，无需额外解析，稳定性提升90%\n- 内置`evaluate()`函数，用标注数据集一键计算F1、召回率，团队能实时监控模型表现并优化提示\n- 调用`ner.batch()`即可并发处理上千份病历，异步支持`acall()`让系统响应更快，处理效率提升8倍\n\nPromptify 让医疗文本分析从手工拼凑的“提示工程作坊”升级为可复用、可评估、可扩展的标准化NLP流水线。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpromptslab_Promptify_5a890630.png","promptslab","PromptsLab","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fpromptslab_f2324167.png","Working on Generative Models | Prompt-Engineering | LLMs",null,"promptslab@gmail.com","https:\u002F\u002Fdiscord.gg\u002Fm88xfYMbK6","https:\u002F\u002Fgithub.com\u002Fpromptslab",[84,88,92],{"name":85,"color":86,"percentage":87},"Python","#3572A5",48,{"name":89,"color":90,"percentage":91},"Jupyter Notebook","#DA5B0B",45.3,{"name":93,"color":94,"percentage":95},"Jinja","#a52a22",6.7,4580,363,"2026-04-05T23:34:55","Apache-2.0",1,"Linux, macOS, Windows","未说明",{"notes":104,"python":105,"dependencies":106},"支持通过 LiteLLM 接入多种 LLM 提供商（如 OpenAI、Claude、Ollama 等），本地模型需自行部署；推荐使用 pip install promptify[eval] 安装评估功能；无需训练数据，但首次调用远程模型可能需网络访问和 API 密钥。","3.9+",[107,108,109,110,111],"pydantic","litellm","openai","anthropic","ollama",[26,53,13],[114,115,116,117,118,119,120,121,122,109,123,124,125,126,127,128,129,130,131,132],"chatgpt","chatgpt-api","gpt-3","gpt-3-prompts","prompt-engineering","prompt-toolkit","prompting","chatgpt-python","gpt3-library","prompt-tuning","prompts","large-language-models","transformers","machine-learning","nlp","gpt-4","gpt-4-api","prompt-versioning","promptversioning","2026-03-27T02:49:30.150509","2026-04-06T08:09:07.555711",[136,141,146,151,156,161],{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},9293,"如何在 Promptify 中实现关系抽取并可视化结果？","可以使用 networkx 和 matplotlib 绘制关系图。输入三元组列表（如 [['Bob', 'is', 'person']]），构建图结构并绘制节点和边，边标签为关系类型。示例代码：import networkx as nx; import matplotlib.pyplot as plt; def visualize(data): G = nx.Graph(); for triplet in data: G.add_node(triplet[0]); G.add_node(triplet[2]); G.add_edge(triplet[0], triplet[2], relation=triplet[1]); pos = nx.spring_layout(G); nx.draw(G, pos, with_labels=True); edge_labels = nx.get_edge_attributes(G, 'relation'); nx.draw_networkx_edge_labels(G, pos, edge_labels); plt.show()。已提供完整示例：https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify\u002Fblob\u002Fmain\u002Fexamples\u002FRelation_extraction.ipynb","https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify\u002Fissues\u002F3",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},9294,"如何解决 OpenAI 返回的单双引号导致 eval() 解析失败的问题？","使用自定义函数转义引号后再解析。推荐方案：使用 ast.literal_eval 配合正则替换，例如 def escaped_(data): escaped_str = re.sub(r'(\\w)(\\')(\\w)', r'\\1\\'\\3', data); return ast.literal_eval(escaped_str)。或根据引号类型动态替换：if \"'\" in data: escaped_str = re.sub(r'(\\w)(\\')(\\w)', r'\\1\\\"\\3', data); else: escaped_str = re.sub(r'(\\w)(\\\")(\\w)', r'\\1\\'\\3', data)。修复已合并至 parser.py 第 78 行。","https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify\u002Fissues\u002F4",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},9295,"为什么无法从 promptify 导入 HubModel？","请确保从 GitHub 直接安装最新版本，而非 PyPI。执行命令：pip3 install git+https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify.git。该问题因模块名称变更导致，官方已修复，直接安装最新代码可解决。","https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify\u002Fissues\u002F56",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},9296,"安装 Promptify 时出现循环导入错误（__version__ 无法导入）怎么办？","该问题由 __init__.py 中循环引用导致。解决方案是重新从 GitHub 安装：pip3 install git+https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify.git。维护者已修复该问题，确保使用最新代码库可避免循环导入。","https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify\u002Fissues\u002F52",{"id":157,"question_zh":158,"answer_zh":159,"source_url":160},9297,"如何在 Promptify 中使用 ChatGPT（gpt-3.5-turbo）模型？","需从 GitHub 安装最新版本：pip3 install git+https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify.git。然后初始化模型时使用 model_name 参数而非 model，例如：model = OpenAI('your-key', model_name='gpt-3.5-turbo')。旧版本不支持该参数，必须使用最新代码。","https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify\u002Fissues\u002F37",{"id":162,"question_zh":163,"answer_zh":164,"source_url":165},9298,"如何在 Promptify 中使用多个少样本示例（few-shot）进行命名实体识别？","通过 examples 参数传入多个 (输入文本, 输出字典) 的元组列表。例如：examples = [(\"Among US Hat Cap Snapback Gift US Seller\", {'T': 'Brand', 'E': 'Among US'}), (\"[New Adhesion Series 5] Braun Mens Electric Shaver 50-R1200s\", {'T': 'Brand', 'E': 'Braun'})]，然后调用 nlp_prompter.fit('ner.jinja', text_input=new_input, examples=examples)。支持任意数量示例，输出将基于示例进行推理。","https:\u002F\u002Fgithub.com\u002Fpromptslab\u002FPromptify\u002Fissues\u002F14",[167],{"id":168,"version":169,"summary_zh":79,"released_at":79},116384,"v2.0.0"]