chenpei d0dc94e36d feat: 将弹幕功能替换为AI聊天助手
新功能:
- 创建AI聊天助手组件(AIChatWidget)
- 支持文字+图片多模态对话
- 集成Gemini AI API
- 支持图片编辑和内容生成
- 实时对话历史管理
- 优雅的UI设计,支持黑夜模式

技术实现:
- 后端API代理Gemini API(/api/ai-chat)
- 支持最多5张图片上传
- 流式响应处理
- 对话历史管理
- Base64图片处理

配置:
- 在.env中添加Gemini API配置
- GEMINI_API_KEY
- GEMINI_API_BASE_URL
- GEMINI_MODEL

替换原弹幕功能,提供更强大的AI助手体验!
2025-10-27 17:45:37 +08:00

148 lines
2.9 KiB
Protocol Buffer
Executable File

syntax = "proto2";
option go_package="./;volc";
option optimize_for = SPEED;
package volc;
enum EntryType {
UNKNOWN_ENTRY = 0;
BEGIN = 1;
COMMIT = 2;
DML = 3;
DDL = 4;
}
enum SrcType {
UNKNOWN_SRC = 0;
MySQL = 1;
PostgreSQL = 2;
}
enum DMLType {
OTHER_DML = 0;
INSERT = 1;
UPDATE = 2;
DELETE = 3;
}
enum DDLType {
OTHER_DDL = 0;
CREATE_TABLE = 2;
ALTER_TABLE = 3;
DROP_TABLE = 4;
RENAME_TABLE = 5;
TRUNCATE_TABLE = 6;
CREATE_VIEW = 7;
ALTER_VIEW = 8;
DROP_VIEW = 9;
CREATE_INDEX = 10;
DROP_INDEX = 11;
CREATE_FUNCTION = 12;
DROP_FUNCTION = 13;
CREATE_PROCEDURE= 14;
DROP_PROCEDURE = 15;
}
enum ColumnType {
UNKNOWN = 0;
STRING = 1;
BINARY = 2;
INTEGER = 3; // store as int64 value
UNSIGNED_INTEGER = 4; // store as uint64 value
FLOAT = 5; // store as float value
DECIMAL = 6; // store as string value
BOOL = 7;
DATETIME = 8; //store in string value in RFC3339Nano format
}
message Entry {
optional int32 version = 1;
repeated Prop props = 2;
optional SrcType src_type = 3;
optional EntryType entry_type = 4;
optional int64 timestamp = 5;
optional string server_id = 6;
optional string database = 7;
optional string table = 8;
oneof event {
DMLEvent dml_event = 21;
DDLEvent ddl_event = 22;
CommitEvent commit_event = 23;
BeginEvent begin_event = 24;
}
}
message Prop{
optional string key = 1;
optional string value = 2;
}
message BeginEvent {
optional string transaction_id = 1;
optional string file = 2;
optional string offset = 3;
repeated Prop props = 4;
}
message CommitEvent {
optional string transaction_id = 1;
optional string file = 2;
optional string offset = 3;
repeated Prop props = 4;
}
message DDLEvent {
optional string sql = 1;
optional int64 exec_time = 2; // unit: second
optional int32 err_code = 3;
repeated Prop props = 4;
optional DDLType type = 5;
}
message DMLEvent {
optional DMLType type = 1;
optional string table_id = 2;
optional Index use_index = 3;
repeated ColumnDef column_defs= 4;
repeated Row rows = 5;
repeated Prop props = 6;
}
message Index {
optional string name = 1;
repeated int32 column_index = 2;
}
message Row {
repeated Column before_cols = 1;
repeated Column after_cols = 2;
}
message ColumnDef {
repeated Prop props = 1;
optional int32 index = 2;
optional ColumnType type = 3;
optional string origin_type = 4;
optional string name = 5;
optional string charset = 6;
optional bool is_nullable = 7;
optional bool is_unsigned = 8;
}
message Column {
optional bool is_null = 1;
oneof value {
string string_value = 2;
bytes binary_value = 3;
double float_value = 4;
int64 int64_value = 5;
uint64 uint64_value = 6;
bool bool_value = 7;
}
}