修改样式,接口

This commit is contained in:
XIE7654
2025-07-17 22:22:10 +08:00
parent e79eb196f2
commit fc96f77499
6 changed files with 121 additions and 54 deletions

View File

@@ -29,14 +29,35 @@ class PlatformChoices:
# 消息类型选择类(示例)
class MessageType:
TEXT = 'text'
IMAGE = 'image'
SYSTEM = "system" # 系统指令
USER = "user" # 用户消息
ASSISTANT = "assistant" # 助手回复
FUNCTION = "function" # 函数返回结果
@staticmethod
def choices():
return [('text', '文本'), ('image', '图片')]
"""返回可用的消息角色选项"""
return [
(MessageType.SYSTEM, "系统"),
(MessageType.USER, "用户"),
(MessageType.ASSISTANT, "助手"),
(MessageType.FUNCTION, "函数")
]
class MessageContentType:
"""消息内容类型"""
TEXT = "text"
FUNCTION_CALL = "function_call"
@staticmethod
def choices():
"""返回可用的内容类型选项"""
return [
(MessageContentType.TEXT, "文本"),
(MessageContentType.FUNCTION_CALL, "函数调用")
]
# AI API 密钥表
class AIApiKey(CoreModel):
__tablename__ = 'ai_api_key'