[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-alfianlosari--ChatGPTSwift":3,"tool-alfianlosari--ChatGPTSwift":64},[4,17,25,39,48,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},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 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":10,"last_commit_at":23,"category_tags":24,"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,15],{"id":26,"name":27,"github_repo":28,"description_zh":29,"stars":30,"difficulty_score":10,"last_commit_at":31,"category_tags":32,"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",[33,34,35,36,14,37,15,13,38],"图像","数据工具","视频","插件","其他","音频",{"id":40,"name":41,"github_repo":42,"description_zh":43,"stars":44,"difficulty_score":45,"last_commit_at":46,"category_tags":47,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,3,"2026-04-04T04:44:48",[14,33,13,15,37],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":45,"last_commit_at":54,"category_tags":55,"status":16},519,"PaddleOCR","PaddlePaddle\u002FPaddleOCR","PaddleOCR 是一款基于百度飞桨框架开发的高性能开源光学字符识别工具包。它的核心能力是将图片、PDF 等文档中的文字提取出来，转换成计算机可读取的结构化数据，让机器真正“看懂”图文内容。\n\n面对海量纸质或电子文档，PaddleOCR 解决了人工录入效率低、数字化成本高的问题。尤其在人工智能领域，它扮演着连接图像与大型语言模型（LLM）的桥梁角色，能将视觉信息直接转化为文本输入，助力智能问答、文档分析等应用场景落地。\n\nPaddleOCR 适合开发者、算法研究人员以及有文档自动化需求的普通用户。其技术优势十分明显：不仅支持全球 100 多种语言的识别，还能在 Windows、Linux、macOS 等多个系统上运行，并灵活适配 CPU、GPU、NPU 等各类硬件。作为一个轻量级且社区活跃的开源项目，PaddleOCR 既能满足快速集成的需求，也能支撑前沿的视觉语言研究，是处理文字识别任务的理想选择。",74913,"2026-04-05T10:44:17",[15,33,13,37],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":45,"last_commit_at":62,"category_tags":63,"status":16},2181,"OpenHands","OpenHands\u002FOpenHands","OpenHands 是一个专注于 AI 驱动开发的开源平台，旨在让智能体（Agent）像人类开发者一样理解、编写和调试代码。它解决了传统编程中重复性劳动多、环境配置复杂以及人机协作效率低等痛点，通过自动化流程显著提升开发速度。\n\n无论是希望提升编码效率的软件工程师、探索智能体技术的研究人员，还是需要快速原型验证的技术团队，都能从中受益。OpenHands 提供了灵活多样的使用方式：既可以通过命令行（CLI）或本地图形界面在个人电脑上轻松上手，体验类似 Devin 的流畅交互；也能利用其强大的 Python SDK 自定义智能体逻辑，甚至在云端大规模部署上千个智能体并行工作。\n\n其核心技术亮点在于模块化的软件智能体 SDK，这不仅构成了平台的引擎，还支持高度可组合的开发模式。此外，OpenHands 在 SWE-bench 基准测试中取得了 77.6% 的优异成绩，证明了其解决真实世界软件工程问题的能力。平台还具备完善的企业级功能，支持与 Slack、Jira 等工具集成，并提供细粒度的权限管理，适合从个人开发者到大型企业的各类用户场景。",70612,"2026-04-05T11:12:22",[15,14,13,36],{"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":76,"owner_location":79,"owner_email":80,"owner_twitter":75,"owner_website":81,"owner_url":82,"languages":83,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":10,"env_os":96,"env_gpu":97,"env_ram":97,"env_deps":98,"category_tags":103,"github_topics":104,"view_count":45,"oss_zip_url":118,"oss_zip_packed_at":118,"status":16,"created_at":119,"updated_at":120,"faqs":121,"releases":162},297,"alfianlosari\u002FChatGPTSwift","ChatGPTSwift","Access ChatGPT API using Swift","ChatGPTSwift 是一款专为 Apple 生态设计的开源库，旨在帮助开发者通过 Swift 语言便捷地接入 OpenAI ChatGPT 官方 API。无论你的目标是 iOS、macOS、tvOS 还是 watchOS 应用，ChatGPTSwift 都能提供原生支持，省去了底层网络请求的复杂配置。\n\n对于希望在应用中集成智能对话功能的 Swift 开发者而言，ChatGPTSwift 解决了跨平台兼容性和上下文管理的难题。它不仅支持标准的 HTTP 请求，还提供流式输出功能，让用户能实时看到生成内容。特别值得一提的是其内置的对话历史管理机制，能够自动追踪会话上下文，并利用 GPTEncoder 库计算 Token 数量，防止超出模型限制，必要时自动截断旧记录以保持对话流畅。\n\n开发者还可以灵活调整模型版本、系统提示词及温度参数，定制个性化的 AI 行为。如果你正在构建需要人工智能交互的苹果平台应用，ChatGPTSwift 提供了高效且可靠的解决方案。","# ChatGPTSwift API\n\n![Alt text](https:\u002F\u002Fimagizer.imageshack.com\u002Fv2\u002F640x480q90\u002F923\u002Fc9MPBA.png \"image\")\n\nAccess OpenAI ChatGPT Official API using Swift. Works on all Apple platforms.\n\n## Supported Platforms\n\n- iOS\u002FtvOS 15 and above\n- macOS 12 and above\n- watchOS 8 and above\n- Linux\n\n## Installation\n\n### Swift Package Manager\n- File > Swift Packages > Add Package Dependency\n- Add https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift.git\n\n### Cocoapods\n```ruby\nplatform :ios, '15.0'\nuse_frameworks!\n\ntarget 'MyApp' do\n  pod 'ChatGPTSwift', '~> 2.5.0'\nend\n```\n\n## Requirement\n\nRegister for API key from [OpenAI](https:\u002F\u002Fopenai.com\u002Fapi). Initialize with api key\n\n```swift\nlet api = ChatGPTAPI(apiKey: \"API_KEY\")\n```\n\n## Usage\n\nThere are 2 APIs: stream and normal\n\n### Stream\n\nThe server will stream chunks of data until complete, the method `AsyncThrowingStream` which you can loop using For-Loop like so:\n\n```swift\nTask {\n    do {\n        let stream = try await api.sendMessageStream(text: \"What is ChatGPT?\")\n        for try await line in stream {\n            print(line)\n        }\n    } catch {\n        print(error.localizedDescription)\n    }\n}\n```\n\n### Normal\nA normal HTTP request and response lifecycle. Server will send the complete text (it will take more time to response)\n\n```swift\nTask {\n    do {\n        let response = try await api.sendMessage(text: \"What is ChatGPT?\")\n        print(response)\n    } catch {\n        print(error.localizedDescription)\n    }\n}\n        \n```\n\n### Providing extra parameters\n\nOptionally, you can provide the model, system prompt, temperature, and model like so.\n\n```swift\nlet response = try await api.sendMessage(text: \"What is ChatGPT?\",\n                                         model: \"gpt-4\",\n                                         systemText: \"You are a CS Professor\",\n                                         temperature: 0.5)\n```\n\nDefault values for these parameters are:\n- model: `gpt-3.5-turbo`\n- systemText: `You're a helpful assistant`\n- temperature: `0.5`\n\nTo learn more about those parameters, you can visit the official [ChatGPT API documentation](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fchat\u002Fintroduction) and [ChatGPT API Introduction Page](https:\u002F\u002Fopenai.com\u002Fblog\u002Fintroducing-chatgpt-and-whisper-apis)\n\n## History List\n\nThe client stores the history list of the conversation that will be included in the new prompt so ChatGPT aware of the previous context of conversation. When sending new prompt, the client will make sure the token count is not exceeding 4096 using [GPTEncoder library](https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FGPTEncoder) to calculate tokens in string, in case it exceeded the token, some of previous conversations will be truncated. In future i will provide an API to specify the token threshold as new gpt-4 model accept much bigger 8k tokens in a prompt.\n\n\n### View Current History List\n\nYou can view current history list from the `historyList` property.\n\n```swift\nprint(api.historyList)\n```\n\n### Delete History List\n\nYou can also delete the history list by invoking\n\n```swift\napi.deleteHistoryList()\n```\n\n### Replace History List\n\nYou can provide your own History List, this will replace the stored history list. Remember not to pass the 4096 tokens threshold.\n\n```swift\nlet myHistoryList = [\n    Message(role: \"user\", content: \"who is james bond?\")\n    Message(role: \"assistant\", content: \"secret british agent with codename 007\"),\n    Message(role: \"user\", content: \"which one is the latest movie?\"),\n    Message(role: \"assistant\", content: \"It's No Time to Die played by Daniel Craig\")\n]\n\napi.replaceHistoryList(with: myHistoryList)\n```\n\n## GPT Encoder Lib\nI've also created [GPTEncoder](https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FGPTEncoder) Swift BPE Encoder\u002FDecoder for OpenAI GPT Models. A programmatic interface for tokenizing text for OpenAI GPT API.\n\n## GPT Tokenizer UI Lib\nI've also created [GPTTokenizerUI](https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FGPTTokenizerUI), a SPM lib you can integrate in your app for providing GUI to input text and show the tokenization results used by GPT API.\n\n![Alt text](https:\u002F\u002Fimagizer.imageshack.com\u002Fv2\u002F640x480q70\u002F922\u002FCEVvrE.png \"image\")\n\n## Demo Apps\nYou can check the demo apps for iOS and macOS from the [SwiftUIChatGPT repo](https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwiftUI)\n","# ChatGPTSwift API\n\n![替代文本](https:\u002F\u002Fimagizer.imageshack.com\u002Fv2\u002F640x480q90\u002F923\u002Fc9MPBA.png \"image\")\n\n使用 Swift 访问 OpenAI ChatGPT 官方 API。适用于所有 Apple 平台。\n\n## 支持的平台\n\n- iOS\u002FtvOS 15 及以上\n- macOS 12 及以上\n- watchOS 8 及以上\n- Linux\n\n## 安装\n\n### Swift Package Manager（Swift 包管理器）\n- 文件 (File) > Swift Packages > 添加包依赖 (Add Package Dependency)\n- 添加 https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift.git\n\n### Cocoapods\n```ruby\nplatform :ios, '15.0'\nuse_frameworks!\n\ntarget 'MyApp' do\n  pod 'ChatGPTSwift', '~> 2.5.0'\nend\n```\n\n## 要求\n\n从 [OpenAI](https:\u002F\u002Fopenai.com\u002Fapi) 注册 API 密钥（API Key）。使用 API 密钥进行初始化\n\n```swift\nlet api = ChatGPTAPI(apiKey: \"API_KEY\")\n```\n\n## 用法\n\n有两种 API：流式（stream）和普通（normal）\n\n### 流式传输 (Stream)\n\n服务器将流式传输数据块直到完成，方法 `AsyncThrowingStream`（异步抛出流）允许你像这样使用 For 循环（For-Loop）进行遍历：\n\n```swift\nTask {\n    do {\n        let stream = try await api.sendMessageStream(text: \"What is ChatGPT?\")\n        for try await line in stream {\n            print(line)\n        }\n    } catch {\n        print(error.localizedDescription)\n    }\n}\n```\n\n### 普通模式 (Normal)\n\n标准的 HTTP 请求和响应生命周期。服务器将发送完整的文本（响应时间会更长）\n\n```swift\nTask {\n    do {\n        let response = try await api.sendMessage(text: \"What is ChatGPT?\")\n        print(response)\n    } catch {\n        print(error.localizedDescription)\n    }\n}\n        \n```\n\n### 提供额外参数\n\n可选地，你可以提供模型（model）、系统提示词（system prompt）、温度（temperature）等参数，如下所示。\n\n```swift\nlet response = try await api.sendMessage(text: \"What is ChatGPT?\",\n                                         model: \"gpt-4\",\n                                         systemText: \"You are a CS Professor\",\n                                         temperature: 0.5)\n```\n\n这些参数的默认值为：\n- model: `gpt-3.5-turbo`\n- systemText: `You're a helpful assistant`\n- temperature: `0.5`\n\n要了解更多关于这些参数的信息，你可以访问官方 [ChatGPT API 文档](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fchat\u002Fintroduction) 和 [ChatGPT API 介绍页面](https:\u002F\u002Fopenai.com\u002Fblog\u002Fintroducing-chatgpt-and-whisper-apis)\n\n## 历史记录列表\n\n客户端会存储对话的历史记录列表，该列表将被包含在新的提示词中，以便 ChatGPT 了解之前的对话上下文。当发送新提示词时，客户端会使用 [GPTEncoder 库](https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FGPTEncoder) 计算字符串中的令牌（Token）数量，确保令牌计数不超过 4096。如果超过令牌限制，部分之前的对话将被截断。未来我将提供一个 API 来指定令牌阈值，因为新的 gpt-4 模型在单个提示词中接受更大的 8k 令牌。\n\n\n### 查看当前历史记录列表\n\n你可以从 `historyList` 属性查看当前的历史记录列表。\n\n```swift\nprint(api.historyList)\n```\n\n### 删除历史记录列表\n\n你也可以通过调用以下方法来删除历史记录列表\n\n```swift\napi.deleteHistoryList()\n```\n\n### 替换历史记录列表\n\n你可以提供自己的历史记录列表，这将替换存储的历史记录列表。请记住不要超过 4096 个令牌的阈值。\n\n```swift\nlet myHistoryList = [\n    Message(role: \"user\", content: \"who is james bond?\")\n    Message(role: \"assistant\", content: \"secret british agent with codename 007\"),\n    Message(role: \"user\", content: \"which one is the latest movie?\"),\n    Message(role: \"assistant\", content: \"It's No Time to Die played by Daniel Craig\")\n]\n\napi.replaceHistoryList(with: myHistoryList)\n```\n\n## GPT Encoder 库\n我还创建了 [GPTEncoder](https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FGPTEncoder) Swift BPE 编码器\u002F解码器，用于 OpenAI GPT 模型。这是一个用于为 OpenAI GPT API 对文本进行标记化（Tokenizing）的编程接口。\n\n## GPT Tokenizer UI 库\n我还创建了 [GPTTokenizerUI](https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FGPTTokenizerUI)，这是一个 SPM 库（Swift Package Manager 库），你可以将其集成到你的应用中，以提供图形用户界面（GUI）输入文本并显示 GPT API 使用的标记化结果。\n\n![替代文本](https:\u002F\u002Fimagizer.imageshack.com\u002Fv2\u002F640x480q70\u002F922\u002FCEVvrE.png \"image\")\n\n## 演示应用\n你可以从 [SwiftUIChatGPT 仓库](https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwiftUI) 查看 iOS 和 macOS 的演示应用","# ChatGPTSwift 快速上手指南\n\nChatGPTSwift 是一个专为 Swift 开发者设计的开源库，用于在 Apple 平台及 Linux 上便捷地调用 OpenAI ChatGPT 官方 API。\n\n## 环境准备\n\n### 系统要求\n- **iOS \u002F tvOS**: 15.0 及以上\n- **macOS**: 12.0 及以上\n- **watchOS**: 8.0 及以上\n- **Linux**: 支持\n\n### 前置依赖\n- 已安装 Xcode（适用于 Apple 平台开发）\n- 拥有有效的 [OpenAI API Key](https:\u002F\u002Fopenai.com\u002Fapi)\n\n## 安装步骤\n\n你可以根据项目需求选择 Swift Package Manager 或 CocoaPods 进行集成。\n\n### 方式一：Swift Package Manager (推荐)\n1. 在 Xcode 中打开项目。\n2. 点击菜单栏 `File` > `Swift Packages` > `Add Package Dependency`。\n3. 输入以下仓库地址并确认：\n```text\nhttps:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift.git\n```\n\n### 方式二：CocoaPods\n在项目根目录的 `Podfile` 中添加以下内容：\n```ruby\nplatform :ios, '15.0'\nuse_frameworks!\n\ntarget 'MyApp' do\n  pod 'ChatGPTSwift', '~> 2.5.0'\nend\n```\n执行 `pod install` 完成安装。\n\n## 基本使用\n\n### 1. 初始化 API\n引入库后，首先需要使用你的 API Key 初始化客户端：\n\n```swift\nlet api = ChatGPTAPI(apiKey: \"API_KEY\")\n```\n\n### 2. 发送消息（普通模式）\n最基础的用法是发送文本请求并获取完整回复：\n\n```swift\nTask {\n    do {\n        let response = try await api.sendMessage(text: \"What is ChatGPT?\")\n        print(response)\n    } catch {\n        print(error.localizedDescription)\n    }\n}\n```\n\n### 3. 发送消息（流式模式）\n如果你需要实时接收数据流，可以使用流式接口：\n\n```swift\nTask {\n    do {\n        let stream = try await api.sendMessageStream(text: \"What is ChatGPT?\")\n        for try await line in stream {\n            print(line)\n        }\n    } catch {\n        print(error.localizedDescription)\n    }\n}\n```\n\n### 4. 自定义参数（可选）\n你可以指定模型、系统提示词和温度等参数：\n\n```swift\nlet response = try await api.sendMessage(text: \"What is ChatGPT?\",\n                                         model: \"gpt-4\",\n                                         systemText: \"You are a CS Professor\",\n                                         temperature: 0.5)\n```\n\n**默认参数说明：**\n- `model`: `gpt-3.5-turbo`\n- `systemText`: `You're a helpful assistant`\n- `temperature`: `0.5`","一位资深 iOS 工程师正在构建一款跨平台的智能会议助手，希望用户在 iPhone、Mac 甚至 Apple Watch 上都能直接与 AI 对话以生成摘要。\n\n### 没有 ChatGPTSwift 时\n- 需自行搭建中间层服务器代理 API 请求，暴露密钥风险且增加运维负担。\n- 手动拼接对话历史字符串，难以动态控制 Token 数量，易触发限流错误。\n- 处理流式数据返回逻辑繁琐，难以保证 UI 渲染的流畅性和实时性。\n- 缺乏统一的参数配置接口，调整模型版本或系统提示词需要重构代码。\n\n### 使用 ChatGPTSwift 后\n- 直接在客户端初始化 API Key，支持 iOS、macOS、watchOS 多端统一接入，架构更轻量安全。\n- 内置历史列表管理功能，自动截断超长上下文，确保对话连贯且合规。\n- 提供 Stream 和 Normal 两种模式，用 For-Loop 即可实现丝滑的流式输出体验。\n- 灵活配置 model、temperature 等参数，轻松定制不同场景下的 AI 回复风格。\n\nChatGPTSwift 彻底消除了苹果生态原生接入大模型的门槛，让开发者能专注于业务创新而非底层通信协议。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Falfianlosari_ChatGPTSwift_7f38fe16.png","alfianlosari","Alfian Losari","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Falfianlosari_eaf64aee.jpg","Passionate engineer that loves all about technology and its value. For me when you stop learning, you will stop going forward.","Indonesia","alfianlosari@gmail.com","https:\u002F\u002Falfianlosari.com","https:\u002F\u002Fgithub.com\u002Falfianlosari",[84,88],{"name":85,"color":86,"percentage":87},"Swift","#F05138",99.9,{"name":89,"color":90,"percentage":91},"Ruby","#701516",0.1,703,140,"2026-04-01T10:05:29","MIT","iOS, tvOS, macOS, watchOS, Linux","未说明",{"notes":99,"python":97,"dependencies":100},"本工具为 Swift 语言编写的 OpenAI API 客户端库，非本地模型运行程序，因此无本地 GPU、内存及 Python 环境要求。必须注册并配置 OpenAI API Key 才能使用。支持 Swift Package Manager 和 CocoaPods 安装。历史记录功能集成 GPTEncoder 库用于 Token 计数（默认限制 4096 Tokens）。",[101,102],"GPTEncoder","GPTTokenizerUI",[15,36],[105,106,107,108,109,110,111,112,113,114,115,116,117],"chatgpt","chatgpt-api","swift","chatgpt-api-wrapper","chatgpt3","gpt4","ios","linux","macos","swift-library","swift-package-manager","tvos","watchos",null,"2026-03-27T02:49:30.150509","2026-04-06T07:14:57.861950",[122,127,132,137,142,147,152,157],{"id":123,"question_zh":124,"answer_zh":125,"source_url":126},1000,"如何将历史记录添加到 API 对话中？","从 1.2.1 版本开始，库提供了公开的替换历史记录列表方法。你可以创建一个接受 Message 数组的公共方法，将其追加到内部历史记录列表中。","https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift\u002Fissues\u002F3",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},1001,"该库支持图像生成功能吗？","支持。图像生成接口已在 2.3.0 版本中添加。如果你需要此功能，请确保升级到 2.3.0 或更高版本。","https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift\u002Fissues\u002F33",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},994,"最新版本出现依赖解析失败错误怎么办？","这是由于 'gptencoder' 版本与工具版本不兼容导致的。维护者已在 1.3.2 版本中修复了此问题，请升级至该版本以解决依赖冲突。","https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift\u002Fissues\u002F10",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},995,"无法使用 Message.init(role:content:) 初始化消息对象？","早期版本忘记将初始化器设为 public。请更新到 1.2.3 版本即可正常使用。如果暂时无法更新，可以使用 JSONDecoder 进行解码作为临时解决方案。","https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift\u002Fissues\u002F4",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},996,"如何检测流式消息发送何时结束？","当 `for try await line in stream` 循环结束时，即表示流式传输停止。你可以在循环代码块之后添加回调逻辑来处理完成状态，无需额外的 finished 回调接口。","https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift\u002Fissues\u002F15",{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},997,"如何取消正在进行的流式请求？","可以通过访问 `public var requestTask : Task\u003CVoid, Never>?` 属性，并调用 `requestTask?.cancel()` 方法来取消当前的流式请求任务。","https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift\u002Fissues\u002F21",{"id":153,"question_zh":154,"answer_zh":155,"source_url":156},998,"在中国地区使用请求超时怎么办？","这通常是因为 OpenAI API 在中国大陆受限。建议尝试使用 VPN 连接网络，或者确认 OpenAI 是否已对该地区开放 API 访问权限。","https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift\u002Fissues\u002F1",{"id":158,"question_zh":159,"answer_zh":160,"source_url":161},999,"在 Mac 上运行项目时找不到应用程序？","这是一个 Swift 库（Library），而不是可执行的应用程序（App）。你需要通过 SPM 或 Cocoapods 将其作为依赖项集成到你自己的应用程序项目中才能运行。","https:\u002F\u002Fgithub.com\u002Falfianlosari\u002FChatGPTSwift\u002Fissues\u002F12",[163,168,173,178,183,188,193,198,203,208,213,218,223,228,233,238,243,248,253,258],{"id":164,"version":165,"summary_zh":166,"released_at":167},110315,"2.5.0","- Add latest gpt-5 models\r\n- Add support to pass raw string model when calling API","2025-08-10T04:18:20",{"id":169,"version":170,"summary_zh":171,"released_at":172},110316,"2.4.4","Make ChatGPTModel conforms to CaseIterable\r\n\r\n","2024-12-19T08:14:47",{"id":174,"version":175,"summary_zh":176,"released_at":177},110317,"2.4.3","Make ChatGPTModel conforms to CaseIterable","2024-12-19T08:07:44",{"id":179,"version":180,"summary_zh":181,"released_at":182},110318,"2.4.2","Fix typo in updateAPIKey method","2024-12-19T07:33:29",{"id":184,"version":185,"summary_zh":186,"released_at":187},110319,"2.4.1","Expose public method to update apiKey in API Client","2024-12-19T07:30:56",{"id":189,"version":190,"summary_zh":191,"released_at":192},110320,"2.4.0","- Add latest models (o1, o1-mini, etc)\r\n- Make apiKey as var instead of let","2024-12-19T07:10:50",{"id":194,"version":195,"summary_zh":196,"released_at":197},110321,"2.3.3","Add GPT-4o mini models","2024-08-28T06:29:26",{"id":199,"version":200,"summary_zh":201,"released_at":202},110322,"2.3.2","Bump Dependencies Version","2024-07-08T10:03:41",{"id":204,"version":205,"summary_zh":206,"released_at":207},110323,"2.3.1","- Add optional maxToken, responseFormat, stop,  imageData params to sendMessage, sendMessageStream, and callFunction APIs\r\n- Add generateDallE3Image method","2024-06-15T13:39:23",{"id":209,"version":210,"summary_zh":211,"released_at":212},110324,"2.3.0","- Add optional imageData param to sendMessage, sendMessageStream, and callFunction APIs\r\n- Add generateDallE3Image method","2024-06-15T02:12:17",{"id":214,"version":215,"summary_zh":216,"released_at":217},110325,"2.2.5","Add error handling for status code 403 and 429","2024-05-26T03:47:21",{"id":219,"version":220,"summary_zh":221,"released_at":222},110326,"2.2.4","Handle 401 API Key error","2024-05-20T16:10:41",{"id":224,"version":225,"summary_zh":226,"released_at":227},110327,"2.2.3","Add typealias for ChatGPTModel enum","2024-05-19T15:19:36",{"id":229,"version":230,"summary_zh":231,"released_at":232},110328,"2.2.2","Add GPT-4o model","2024-05-19T15:12:33",{"id":234,"version":235,"summary_zh":236,"released_at":237},110329,"2.2.1","- Add parameter for language to transcribe audio","2024-04-21T12:28:35",{"id":239,"version":240,"summary_zh":241,"released_at":242},110330,"2.2.0","- add transcibe audio and text to speech","2024-04-21T11:52:14",{"id":244,"version":245,"summary_zh":246,"released_at":247},110331,"2.1.0","- Add Function Call","2024-04-21T08:26:31",{"id":249,"version":250,"summary_zh":251,"released_at":252},110332,"2.0.0","Refactor to use swift open-api generator\r\n","2024-04-13T11:33:42",{"id":254,"version":255,"summary_zh":256,"released_at":257},110333,"1.7.0","Add Callback APIs","2024-04-05T00:51:39",{"id":259,"version":260,"summary_zh":261,"released_at":262},110334,"1.6.0","Remove asynchttpclient\u002Fswift nio dependency","2024-04-04T03:46:15"]