setupViews()
setupChatCallBack()
//设置默认平台
- self.title = MSPlatform.doubao.title
- MixSdk.shared.setPlatform(.doubao)
+ self.title = MSPlatform.deepseek.title
+ MixSdk.shared.setPlatform(.deepseek)
}
let toolBar = SendToolBar()
toolBar.textField.text = "写一个800字的作文"
+ toolBar.textField.text = "你是deepseek还是火山"
+
toolBar.delegate = self
view.addSubview(toolBar)
toolBar.snp.makeConstraints { make in
@objc func changePlatform(){
let vc = UIAlertController(title: nil, message: "请选择", preferredStyle: .actionSheet)
+ vc.addAction( UIAlertAction(title: MSPlatform.deepseek.title, style: .default) { action in
+ self.title = MSPlatform.deepseek.title
+ MixSdk.shared.setPlatform(.deepseek)
+ })
vc.addAction( UIAlertAction(title: MSPlatform.doubao.title, style: .default) { action in
self.title = MSPlatform.doubao.title
MixSdk.shared.setPlatform(.doubao)
////let productId = "pafOCKLiUbeVHbdZlddH"
////let productKey = "HHosiYUNdG42t1cTgKOzIUPOvAVMI2QT"
//
-//
+//kumi
//let deviceId = "28110687C456"
//let productId = "Y1DxRdBfnzVZQrXHdrNl"
//let productKey = "4EepovakpbqhZUnUDwH42KAADYGv4UUe"
-//28110687C457
+//28110687C457,北科
let deviceId = "28110687C456"
let productId = "WTxAKo2qD2pXOZZLW3zz"
let productKey = "YqggeKCxfEOVQGjUYrpQQdEstGpvojzn"
}
func webSocketMessageData(_ data: Data){
-// Logger.log("MSChat receive",data.joined(""))
+ Logger.log("MSChat receive",MSTool.dataToJson(data) ?? "")
if let model = MSChatModel.decode(data){
- Logger.log("\(model.type) : \(model.content ?? "")")
+// Logger.log("\(model.type) : \(model.reasoning_content ?? (model.content ?? ""))")
lastChatModel = model
callBack?(model)
}
/// 内容
public var content:String?
+ /// 深度思考,deepseek才有
+ public var reasoning_content:String?
}
}
static func webSocketUrl(api:String,addPlatform:Bool)->String{
if addPlatform{
- return wsBaseURL + api + "?platform=\(MixSdk.shared.aiPlatform.value)&is_auth=1&dt=\(MixSdk.shared.auth.deviceToken)"
+ if MixSdk.shared.aiPlatform == .deepseek {
+ return wsBaseURL + api + "?platform=huoshan&is_auth=1&dt=\(MixSdk.shared.auth.deviceToken)&model=ep-20250206162546-g74w6"
+ }
+ else{
+ return wsBaseURL + api + "?platform=\(MixSdk.shared.aiPlatform.value)&is_auth=1&dt=\(MixSdk.shared.auth.deviceToken)"
+ }
}
else{
return wsBaseURL + api + "?platform=aliyun&is_auth=1&dt=\(MixSdk.shared.auth.deviceToken)"
case kimi
/// chatGPT
case chatGPT
+ // deepseek
+ case deepseek
internal var value:String{
switch self {
return "moonshot"
case .chatGPT:
return "chatGPT"
-
+ case .deepseek:
+ return "deepseek"
}
}
return "kimi"
case .chatGPT:
return "ChatGPT"
+ case .deepseek:
+ return "deepseek"
}
}
}
public var logs: [String] { Logger.logs }
/// SDK 版本号
- public let version: String = "2025010201"
+ public let version: String = "2025022701"
/// 默认为 false
public var isDebug: Bool = false {
didSet {
## 介绍
-- 当前版本:v2025010201
+- 当前版本:v2025022701
- 更新内容:
- 1. å\85¼å®¹xcode16.2
+ 1. 大模å\9e\8bæ\94¯æ\8c\81deepseek
/// chatGPT
case chatGPT
+
+ /// deepseek
+ case deepseek
public var title: String { get }
}
/// 内容
public var content: String?
+
+ /// 深度思考,deepseek才有
+ public var reasoning_content:String?
}
```