141 lines
3.5 KiB
Swift
141 lines
3.5 KiB
Swift
//
|
||
// AIDicts.swift
|
||
// Crush
|
||
//
|
||
// Created by Leon on 2025/7/29.
|
||
//
|
||
|
||
// MARK: - AI Dict
|
||
|
||
/// AI字典信息
|
||
struct AIDictInfo: Codable {
|
||
/// 角色字典
|
||
var roleDictList: [DictNode]?
|
||
/// 性格字典
|
||
var characterDictList: [DictNode]?
|
||
/// 标签字典
|
||
var tagDictList: [DictNode]?
|
||
var imageStyleDictList: [ImageStylePic]?
|
||
/// 图片样式结构
|
||
// var imageStylePicList: [ImageStylePic]?
|
||
/// 音色结构
|
||
var timbreDictList: [TimbreDict]?
|
||
}
|
||
|
||
struct DictNode: Codable {
|
||
var code: String?
|
||
var name: String = "-"
|
||
var childDictList: [DictNode]?
|
||
}
|
||
|
||
/**
|
||
{
|
||
"prompt": "https://public-pictures.epal.gg/app/images/chatRoom/gift/ordinary/Luv_ya.png",
|
||
"sort": 0,
|
||
"url": "https://public-pictures.epal.gg/app/images/chatRoom/gift/ordinary/Luv_ya.png",
|
||
"id": 1,
|
||
"code": "IS0001",
|
||
"isDelete": 0,
|
||
"createTime": null,
|
||
"name": "风格1"
|
||
}
|
||
*/
|
||
struct ImageStylePic: Codable {
|
||
var prompt: String?
|
||
var sort: Int?
|
||
var url: String?
|
||
var id: Int?
|
||
var code: String?
|
||
var isDelete: Int = 0
|
||
var createTime: String?
|
||
var name: String = ""
|
||
}
|
||
|
||
/// 音色结构
|
||
struct TimbreDict: Codable {
|
||
var id: Int?
|
||
var type: Int?
|
||
var supportEmotions: String?
|
||
var code: String?
|
||
/// 少年男音
|
||
var name: String?
|
||
/// 男;少年;英气
|
||
var description: String?
|
||
var url: String?
|
||
var isDelete: Int?
|
||
var createTime: String?
|
||
var voiceType: String?
|
||
var voiceText: String?
|
||
|
||
/// 默认音高。 -5
|
||
var pitchRate: Int?
|
||
/// 默认速度。 10
|
||
var speechRate: Int?
|
||
/*
|
||
{
|
||
"description" : "男;少年;温柔",
|
||
"id" : 1,
|
||
"supportEmotions" : null,
|
||
"url" : "https:\/\/hhb.crushlevel.ai\/static\/sound\/TB0001.mp3",
|
||
"type" : 1,
|
||
"isDelete" : 0,
|
||
"code" : "TB0001",
|
||
"createTime" : null,
|
||
"language" : null,
|
||
"voiceText" : "你好,我是荒野大镖客",
|
||
"voiceType" : "S_vrx7PzCx1",
|
||
"name" : "温柔男声"
|
||
}
|
||
*/
|
||
}
|
||
|
||
// MARK: - Gift
|
||
|
||
struct GiftDictModel: Codable{
|
||
var name: String?
|
||
var sort: Int?
|
||
var id: Int?
|
||
var price: Int?
|
||
var heartbeatLevel: HeartbeatLevel?
|
||
var startVal: Int?
|
||
var desc: String?
|
||
var icon: String?
|
||
/// 是否是会员礼物
|
||
var isMemberGift: Bool?
|
||
/*
|
||
{
|
||
"name": "交朋友",
|
||
"sort": 1,
|
||
"id": 1,
|
||
"price": 10,
|
||
"heartbeatLevel": null,
|
||
"startVal": null,
|
||
"desc": null,
|
||
"isMemberGift": true,
|
||
"icon": "https://public-pictures.epal.gg/app/images/chatRoom/gift/ordinary/Lolipop.png"
|
||
}*/
|
||
}
|
||
|
||
// MARK: - ChatModel
|
||
|
||
struct AIChatModel: Codable {
|
||
var code: String? // 对话模型code
|
||
var name: String? // 对话模型名称
|
||
var description: String? // 对话模型描述
|
||
var textPrice: Int? // 文本价格
|
||
var voicePrice: Int? // 语音价格
|
||
var voiceChatPrice: Int? // 语音聊天价格
|
||
var questionMark: String? // 问号图标内容
|
||
/*
|
||
{
|
||
"code": "CM0002",
|
||
"questionMark": "2文本消息价格是指与角色进行文本消息对话的价格,含发送语音,含发送图片,发送礼物
|
||
语音通话消息价格是指与角色进行语音电话对话的价格,按条计算",
|
||
"textPrice": 220,
|
||
"voiceChatPrice": 240,
|
||
"description": "2与AI进行角色扮演对话",
|
||
"name": "2角色扮演模型"
|
||
}
|
||
*/
|
||
}
|