AIConversationKit component in a short time. Following this guide, you will complete the following key steps within 20 minutes and implement a conversational AI project with a complete UI.Conversational AI Interface ![]() |
|


Podfile of your project, add the following dependencies:pod 'AIConversationKit',:path => 'AIConversationKit.podspec':
pod install to complete the installation of dependencies;.xcworkspace and configure the certificate information:
TUILogin. This step is critical because only after logging in can AIConversationkit features be used properly. Please patiently check if the relevant parameters are configured correctly.import TUICoreimport AIConversationKitfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {let sdkAppId = 1600000001 // Please replace with your sdkAppIdlet userId = "people" // Please replace with your UserIDlet secretKey = "xxx" // Please replace with your sdkSecretKeylet userSig = GenerateTestUserSig.genTestUserSig(sdkAppId: sdkAppId, identifier: userId, secrectkey: secretKey)TUILogin.login(Int32(sdkAppId), userID: userId, userSig:userSig){print("login success")} fail: { code, message inprint("login failed, code: \\(code), error: \\(message ?? "nil")")}return true}
Parameter | Type | Description |
userID | String | Customers customize their Custom User IDs according to their own business, only allowing a combination of uppercase and lowercase letters (a-z A-Z), numbers (0-9), underline, and hyphen. |
sdkAppID | Int32 | |
secretKey | String | |
userSig | String | A security protection signature used for user login authentication, confirming the authenticity of the user, and preventing malicious attackers from misappropriating your cloud service usage rights. |
let startParams = StartAIConversationParams()let sdkAppId = 1600000001 // 1,Replace your sdkAppIdlet secretKey = "xxx" // 2,Replace your sdkSecretKeylet aiRobotId = "robot_\\(TUILogin.getUserID() ?? "")"let aiRobotSig = GenerateTestUserSig.genTestUserSig(sdkAppId: sdkAppId, identifier: aiRobotId, secrectkey: secretKey)startParams.agentConfig = AIConversationDefine.AgentConfig.generateDefaultConfig(aiRobotId: aiRobotId, aiRobotSig: aiRobotSig)startParams.secretId = "xxx" // 3,Replace your secretIdstartParams.secretKey = "xxx" // 4,Replace your secretKey// 5,Replace your llmConfigstartParams.llmConfig = "{\\"LLMType\\":\\"openai\\",\\"Model\\":\\"hunyuan-turbo-latest\\",\\"SystemPrompt\\":\\"You are a personal assistant\\",\\"APIUrl\\":\\"https://hunyuan.cloud.tencent.com/openai/v1/chat/completions\\",\\"APIKey\\":\\"xxxx\\",\\"History\\":5,\\"Streaming\\":true}"// 6,Replace your ttsConfigstartParams.ttsConfig = "{\\"TTSType\\":\\"tencent\\",\\"AppId\\":\\"xxx\\",\\"SecretId\\":\\"xxx\\",\\"SecretKey\\":\\"xxx\\",\\"VoiceType\\":\\"502001\\",\\"Speed\\":1.25,\\"Volume\\":5,\\"PrimaryLanguage\\":1,\\"FastVoiceType\\":\\"\\"}"let aiViewController = AIConversationViewController(aiParams: startParams)navigationController?.pushViewController(aiViewController, animated: true)

startParams.secretId and startParams.secretKey.startParams.llmConfig, and copy the string value corresponding to TTSConfig to startParams.ttsConfig.Feedback