加了支持deepseek deepseek dev master deepseek
authorliangzhenying <867174124@qq.com>
Thu, 27 Feb 2025 02:31:12 +0000 (10:31 +0800)
committerliangzhenying <867174124@qq.com>
Thu, 27 Feb 2025 02:31:12 +0000 (10:31 +0800)
MixSdk/Example/Example/ChatViewController.swift
MixSdk/Example/Example/Config.swift
MixSdk/MixSdk/MixSdk/MSChat.swift
MixSdk/MixSdk/MixSdk/MSChatModel.swift
MixSdk/MixSdk/MixSdk/MixSdk.swift
MixSdk_iOS_v2025022701.zip [new file with mode: 0644]
document/MixSdk_iOS接口文档.md [moved from document/MixSdk接口文档.md with 99% similarity]
document/MixSdk_iOS接口文档.pdf [deleted file]

index 9d1f30d..e71f147 100644 (file)
@@ -21,8 +21,8 @@ class ChatViewController: UIViewController{
         setupViews()
         setupChatCallBack()
         //设置默认平台
-        self.title = MSPlatform.doubao.title
-        MixSdk.shared.setPlatform(.doubao)
+        self.title = MSPlatform.deepseek.title
+        MixSdk.shared.setPlatform(.deepseek)
     }
     
     
@@ -33,6 +33,8 @@ class ChatViewController: UIViewController{
         
         let toolBar = SendToolBar()
         toolBar.textField.text = "写一个800字的作文"
+        toolBar.textField.text = "你是deepseek还是火山"
+
         toolBar.delegate = self
         view.addSubview(toolBar)
         toolBar.snp.makeConstraints { make in
@@ -86,6 +88,10 @@ class ChatViewController: UIViewController{
     
     @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)
index a8650cc..76d5f69 100644 (file)
@@ -17,13 +17,13 @@ let gptModel = "gpt-4-turbo"
 ////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"
index 18d23b1..af55b43 100644 (file)
@@ -122,10 +122,10 @@ extension MSChat:WebSocketDelegate{
     }
     
     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)
         }
index afee07c..24e1477 100644 (file)
@@ -13,5 +13,7 @@ public class MSChatModel:Codable{
     /// 内容
     public var content:String?
     
+    /// 深度思考,deepseek才有
+    public var reasoning_content:String?
     
 }
index cd781ea..5066e61 100644 (file)
@@ -76,7 +76,12 @@ class MSConfig{
     }
     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)"
@@ -100,6 +105,8 @@ public enum MSPlatform {
     case kimi
     /// chatGPT
     case chatGPT
+    // deepseek
+    case deepseek
     
     internal var value:String{
         switch self {
@@ -115,7 +122,8 @@ public enum MSPlatform {
             return "moonshot"
         case .chatGPT:
             return "chatGPT"
-
+        case .deepseek:
+            return "deepseek"
         }
     }
     
@@ -133,6 +141,8 @@ public enum MSPlatform {
             return "kimi"
         case .chatGPT:
             return "ChatGPT"
+        case .deepseek:
+            return "deepseek"
         }
     }
 }
@@ -158,7 +168,7 @@ public class MixSdk:NSObject {
     public var logs: [String] { Logger.logs }
     
     /// SDK 版本号
-    public let version: String = "2025010201"
+    public let version: String = "2025022701"
     /// 默认为 false
     public var isDebug: Bool = false {
         didSet {
diff --git a/MixSdk_iOS_v2025022701.zip b/MixSdk_iOS_v2025022701.zip
new file mode 100644 (file)
index 0000000..05e0f09
Binary files /dev/null and b/MixSdk_iOS_v2025022701.zip differ
similarity index 99%
rename from document/MixSdk接口文档.md
rename to document/MixSdk_iOS接口文档.md
index 503ddbc..cc6c902 100644 (file)
@@ -2,10 +2,10 @@
 
 ## 介绍
 
-- 当前版本:v2025010201
+- 当前版本:v2025022701
 
 - 更新内容:
-  1. å\85¼å®¹xcode16.2
+  1. å¤§æ¨¡å\9e\8bæ\94¯æ\8c\81deepseek
   
      
   
@@ -414,6 +414,9 @@ public enum MSPlatform {
 
     /// chatGPT
     case chatGPT
+  
+    /// deepseek
+    case deepseek
 
     public var title: String { get }
 }
@@ -541,6 +544,9 @@ public class MSChatModel : Codable {
 
     /// 内容
     public var content: String?
+  
+    /// 深度思考,deepseek才有
+    public var reasoning_content:String?
 }
 ```
 
diff --git a/document/MixSdk_iOS接口文档.pdf b/document/MixSdk_iOS接口文档.pdf
deleted file mode 100644 (file)
index 43cf6ad..0000000
Binary files "a/document/MixSdk_iOS\346\216\245\345\217\243\346\226\207\346\241\243.pdf" and /dev/null differ