193e47842596f0d38db821c142ddd78c947a27d2
W2 plan Task 6 写的 LLMSession 草稿在 4 处与真实 API 不符:
- container.perform 的 context 是具体 ModelContext struct
- MLXLMCommon.generate 是顶层函数,只 try 不 await,返回 AsyncStream 非 Throwing
- Generation 有第三个 case .toolCall,switch 必须穷举
- GenerateParameters 需要 maxTokens,且 temperature/topP 是 Float
- 取消传播需 continuation.onTermination = { _ in task.cancel() }
本笔记含完整修正版 LLMSession.swift,Task 6 implementer 必用此为准。
参考:mlx-swift-examples tag 2.29.1,commit 9bff95ca。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Description
No description provided
Languages
Swift
99.1%
Shell
0.9%