新功能: - 创建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助手体验!
183 lines
9.5 KiB
Python
Executable File
183 lines
9.5 KiB
Python
Executable File
# -*- coding: utf-8 -*-
|
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
# source: volc.proto
|
|
"""Generated protocol buffer code."""
|
|
from google.protobuf.internal import enum_type_wrapper
|
|
from google.protobuf import descriptor as _descriptor
|
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
from google.protobuf import message as _message
|
|
from google.protobuf import reflection as _reflection
|
|
from google.protobuf import symbol_database as _symbol_database
|
|
# @@protoc_insertion_point(imports)
|
|
|
|
_sym_db = _symbol_database.Default()
|
|
|
|
|
|
|
|
|
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nvolc.proto\x12\x04volc\"\xe7\x02\n\x05\x45ntry\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12\x19\n\x05props\x18\x02 \x03(\x0b\x32\n.volc.Prop\x12\x1f\n\x08src_type\x18\x03 \x01(\x0e\x32\r.volc.SrcType\x12#\n\nentry_type\x18\x04 \x01(\x0e\x32\x0f.volc.EntryType\x12\x11\n\ttimestamp\x18\x05 \x01(\x03\x12\x11\n\tserver_id\x18\x06 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x07 \x01(\t\x12\r\n\x05table\x18\x08 \x01(\t\x12#\n\tdml_event\x18\x15 \x01(\x0b\x32\x0e.volc.DMLEventH\x00\x12#\n\tddl_event\x18\x16 \x01(\x0b\x32\x0e.volc.DDLEventH\x00\x12)\n\x0c\x63ommit_event\x18\x17 \x01(\x0b\x32\x11.volc.CommitEventH\x00\x12\'\n\x0b\x62\x65gin_event\x18\x18 \x01(\x0b\x32\x10.volc.BeginEventH\x00\x42\x07\n\x05\x65vent\"\"\n\x04Prop\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"]\n\nBeginEvent\x12\x16\n\x0etransaction_id\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\t\x12\x19\n\x05props\x18\x04 \x03(\x0b\x32\n.volc.Prop\"^\n\x0b\x43ommitEvent\x12\x16\n\x0etransaction_id\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\t\x12\x19\n\x05props\x18\x04 \x03(\x0b\x32\n.volc.Prop\"t\n\x08\x44\x44LEvent\x12\x0b\n\x03sql\x18\x01 \x01(\t\x12\x11\n\texec_time\x18\x02 \x01(\x03\x12\x10\n\x08\x65rr_code\x18\x03 \x01(\x05\x12\x19\n\x05props\x18\x04 \x03(\x0b\x32\n.volc.Prop\x12\x1b\n\x04type\x18\x05 \x01(\x0e\x32\r.volc.DDLType\"\xb3\x01\n\x08\x44MLEvent\x12\x1b\n\x04type\x18\x01 \x01(\x0e\x32\r.volc.DMLType\x12\x10\n\x08table_id\x18\x02 \x01(\t\x12\x1e\n\tuse_index\x18\x03 \x01(\x0b\x32\x0b.volc.Index\x12$\n\x0b\x63olumn_defs\x18\x04 \x03(\x0b\x32\x0f.volc.ColumnDef\x12\x17\n\x04rows\x18\x05 \x03(\x0b\x32\t.volc.Row\x12\x19\n\x05props\x18\x06 \x03(\x0b\x32\n.volc.Prop\"+\n\x05Index\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x63olumn_index\x18\x02 \x03(\x05\"J\n\x03Row\x12!\n\x0b\x62\x65\x66ore_cols\x18\x01 \x03(\x0b\x32\x0c.volc.Column\x12 \n\nafter_cols\x18\x02 \x03(\x0b\x32\x0c.volc.Column\"\xb3\x01\n\tColumnDef\x12\x19\n\x05props\x18\x01 \x03(\x0b\x32\n.volc.Prop\x12\r\n\x05index\x18\x02 \x01(\x05\x12\x1e\n\x04type\x18\x03 \x01(\x0e\x32\x10.volc.ColumnType\x12\x13\n\x0borigin_type\x18\x04 \x01(\t\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x0f\n\x07\x63harset\x18\x06 \x01(\t\x12\x13\n\x0bis_nullable\x18\x07 \x01(\x08\x12\x13\n\x0bis_unsigned\x18\x08 \x01(\x08\"\xae\x01\n\x06\x43olumn\x12\x0f\n\x07is_null\x18\x01 \x01(\x08\x12\x16\n\x0cstring_value\x18\x02 \x01(\tH\x00\x12\x16\n\x0c\x62inary_value\x18\x03 \x01(\x0cH\x00\x12\x15\n\x0b\x66loat_value\x18\x04 \x01(\x01H\x00\x12\x15\n\x0bint64_value\x18\x05 \x01(\x03H\x00\x12\x16\n\x0cuint64_value\x18\x06 \x01(\x04H\x00\x12\x14\n\nbool_value\x18\x07 \x01(\x08H\x00\x42\x07\n\x05value*G\n\tEntryType\x12\x11\n\rUNKNOWN_ENTRY\x10\x00\x12\t\n\x05\x42\x45GIN\x10\x01\x12\n\n\x06\x43OMMIT\x10\x02\x12\x07\n\x03\x44ML\x10\x03\x12\x07\n\x03\x44\x44L\x10\x04*5\n\x07SrcType\x12\x0f\n\x0bUNKNOWN_SRC\x10\x00\x12\t\n\x05MySQL\x10\x01\x12\x0e\n\nPostgreSQL\x10\x02*<\n\x07\x44MLType\x12\r\n\tOTHER_DML\x10\x00\x12\n\n\x06INSERT\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03*\x95\x02\n\x07\x44\x44LType\x12\r\n\tOTHER_DDL\x10\x00\x12\x10\n\x0c\x43REATE_TABLE\x10\x02\x12\x0f\n\x0b\x41LTER_TABLE\x10\x03\x12\x0e\n\nDROP_TABLE\x10\x04\x12\x10\n\x0cRENAME_TABLE\x10\x05\x12\x12\n\x0eTRUNCATE_TABLE\x10\x06\x12\x0f\n\x0b\x43REATE_VIEW\x10\x07\x12\x0e\n\nALTER_VIEW\x10\x08\x12\r\n\tDROP_VIEW\x10\t\x12\x10\n\x0c\x43REATE_INDEX\x10\n\x12\x0e\n\nDROP_INDEX\x10\x0b\x12\x13\n\x0f\x43REATE_FUNCTION\x10\x0c\x12\x11\n\rDROP_FUNCTION\x10\r\x12\x14\n\x10\x43REATE_PROCEDURE\x10\x0e\x12\x12\n\x0e\x44ROP_PROCEDURE\x10\x0f*\x84\x01\n\nColumnType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06STRING\x10\x01\x12\n\n\x06\x42INARY\x10\x02\x12\x0b\n\x07INTEGER\x10\x03\x12\x14\n\x10UNSIGNED_INTEGER\x10\x04\x12\t\n\x05\x46LOAT\x10\x05\x12\x0b\n\x07\x44\x45\x43IMAL\x10\x06\x12\x08\n\x04\x42OOL\x10\x07\x12\x0c\n\x08\x44\x41TETIME\x10\x08\x42\x0bH\x01Z\x07./;volc')
|
|
|
|
_ENTRYTYPE = DESCRIPTOR.enum_types_by_name['EntryType']
|
|
EntryType = enum_type_wrapper.EnumTypeWrapper(_ENTRYTYPE)
|
|
_SRCTYPE = DESCRIPTOR.enum_types_by_name['SrcType']
|
|
SrcType = enum_type_wrapper.EnumTypeWrapper(_SRCTYPE)
|
|
_DMLTYPE = DESCRIPTOR.enum_types_by_name['DMLType']
|
|
DMLType = enum_type_wrapper.EnumTypeWrapper(_DMLTYPE)
|
|
_DDLTYPE = DESCRIPTOR.enum_types_by_name['DDLType']
|
|
DDLType = enum_type_wrapper.EnumTypeWrapper(_DDLTYPE)
|
|
_COLUMNTYPE = DESCRIPTOR.enum_types_by_name['ColumnType']
|
|
ColumnType = enum_type_wrapper.EnumTypeWrapper(_COLUMNTYPE)
|
|
UNKNOWN_ENTRY = 0
|
|
BEGIN = 1
|
|
COMMIT = 2
|
|
DML = 3
|
|
DDL = 4
|
|
UNKNOWN_SRC = 0
|
|
MySQL = 1
|
|
PostgreSQL = 2
|
|
OTHER_DML = 0
|
|
INSERT = 1
|
|
UPDATE = 2
|
|
DELETE = 3
|
|
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
|
|
UNKNOWN = 0
|
|
STRING = 1
|
|
BINARY = 2
|
|
INTEGER = 3
|
|
UNSIGNED_INTEGER = 4
|
|
FLOAT = 5
|
|
DECIMAL = 6
|
|
BOOL = 7
|
|
DATETIME = 8
|
|
|
|
|
|
_ENTRY = DESCRIPTOR.message_types_by_name['Entry']
|
|
_PROP = DESCRIPTOR.message_types_by_name['Prop']
|
|
_BEGINEVENT = DESCRIPTOR.message_types_by_name['BeginEvent']
|
|
_COMMITEVENT = DESCRIPTOR.message_types_by_name['CommitEvent']
|
|
_DDLEVENT = DESCRIPTOR.message_types_by_name['DDLEvent']
|
|
_DMLEVENT = DESCRIPTOR.message_types_by_name['DMLEvent']
|
|
_INDEX = DESCRIPTOR.message_types_by_name['Index']
|
|
_ROW = DESCRIPTOR.message_types_by_name['Row']
|
|
_COLUMNDEF = DESCRIPTOR.message_types_by_name['ColumnDef']
|
|
_COLUMN = DESCRIPTOR.message_types_by_name['Column']
|
|
Entry = _reflection.GeneratedProtocolMessageType('Entry', (_message.Message,), {
|
|
'DESCRIPTOR' : _ENTRY,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.Entry)
|
|
})
|
|
_sym_db.RegisterMessage(Entry)
|
|
|
|
Prop = _reflection.GeneratedProtocolMessageType('Prop', (_message.Message,), {
|
|
'DESCRIPTOR' : _PROP,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.Prop)
|
|
})
|
|
_sym_db.RegisterMessage(Prop)
|
|
|
|
BeginEvent = _reflection.GeneratedProtocolMessageType('BeginEvent', (_message.Message,), {
|
|
'DESCRIPTOR' : _BEGINEVENT,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.BeginEvent)
|
|
})
|
|
_sym_db.RegisterMessage(BeginEvent)
|
|
|
|
CommitEvent = _reflection.GeneratedProtocolMessageType('CommitEvent', (_message.Message,), {
|
|
'DESCRIPTOR' : _COMMITEVENT,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.CommitEvent)
|
|
})
|
|
_sym_db.RegisterMessage(CommitEvent)
|
|
|
|
DDLEvent = _reflection.GeneratedProtocolMessageType('DDLEvent', (_message.Message,), {
|
|
'DESCRIPTOR' : _DDLEVENT,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.DDLEvent)
|
|
})
|
|
_sym_db.RegisterMessage(DDLEvent)
|
|
|
|
DMLEvent = _reflection.GeneratedProtocolMessageType('DMLEvent', (_message.Message,), {
|
|
'DESCRIPTOR' : _DMLEVENT,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.DMLEvent)
|
|
})
|
|
_sym_db.RegisterMessage(DMLEvent)
|
|
|
|
Index = _reflection.GeneratedProtocolMessageType('Index', (_message.Message,), {
|
|
'DESCRIPTOR' : _INDEX,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.Index)
|
|
})
|
|
_sym_db.RegisterMessage(Index)
|
|
|
|
Row = _reflection.GeneratedProtocolMessageType('Row', (_message.Message,), {
|
|
'DESCRIPTOR' : _ROW,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.Row)
|
|
})
|
|
_sym_db.RegisterMessage(Row)
|
|
|
|
ColumnDef = _reflection.GeneratedProtocolMessageType('ColumnDef', (_message.Message,), {
|
|
'DESCRIPTOR' : _COLUMNDEF,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.ColumnDef)
|
|
})
|
|
_sym_db.RegisterMessage(ColumnDef)
|
|
|
|
Column = _reflection.GeneratedProtocolMessageType('Column', (_message.Message,), {
|
|
'DESCRIPTOR' : _COLUMN,
|
|
'__module__' : 'volc_pb2'
|
|
# @@protoc_insertion_point(class_scope:volc.Column)
|
|
})
|
|
_sym_db.RegisterMessage(Column)
|
|
|
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
|
DESCRIPTOR._options = None
|
|
DESCRIPTOR._serialized_options = b'H\001Z\007./;volc'
|
|
_ENTRYTYPE._serialized_start=1389
|
|
_ENTRYTYPE._serialized_end=1460
|
|
_SRCTYPE._serialized_start=1462
|
|
_SRCTYPE._serialized_end=1515
|
|
_DMLTYPE._serialized_start=1517
|
|
_DMLTYPE._serialized_end=1577
|
|
_DDLTYPE._serialized_start=1580
|
|
_DDLTYPE._serialized_end=1857
|
|
_COLUMNTYPE._serialized_start=1860
|
|
_COLUMNTYPE._serialized_end=1992
|
|
_ENTRY._serialized_start=21
|
|
_ENTRY._serialized_end=380
|
|
_PROP._serialized_start=382
|
|
_PROP._serialized_end=416
|
|
_BEGINEVENT._serialized_start=418
|
|
_BEGINEVENT._serialized_end=511
|
|
_COMMITEVENT._serialized_start=513
|
|
_COMMITEVENT._serialized_end=607
|
|
_DDLEVENT._serialized_start=609
|
|
_DDLEVENT._serialized_end=725
|
|
_DMLEVENT._serialized_start=728
|
|
_DMLEVENT._serialized_end=907
|
|
_INDEX._serialized_start=909
|
|
_INDEX._serialized_end=952
|
|
_ROW._serialized_start=954
|
|
_ROW._serialized_end=1028
|
|
_COLUMNDEF._serialized_start=1031
|
|
_COLUMNDEF._serialized_end=1210
|
|
_COLUMN._serialized_start=1213
|
|
_COLUMN._serialized_end=1387
|
|
# @@protoc_insertion_point(module_scope)
|