mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-05-31 00:29:32 +08:00
- 消息管理:新增聊天气泡的重试、编辑与单条删除功能及相对应的持久化状态函数 - 快捷操作:支持长文一键滑动到底端,并在代码块内增加SQL一键送入编辑器的快捷执行机制 - 视觉优化:深化AI回复背景沉浸感,重绘AI洞察按钮并移除设置面板所有的冗余紫色调 - 设置调优:放宽模型初始必填限制,新增内置系统提示词(Builtin Prompt)全览面板
43 lines
1.4 KiB
Go
43 lines
1.4 KiB
Go
package aicontext
|
|
|
|
// DatabaseContext 数据库上下文信息,传递给 AI 辅助上下文理解
|
|
type DatabaseContext struct {
|
|
DatabaseType string `json:"databaseType"` // mysql, postgres 等
|
|
DatabaseName string `json:"databaseName"`
|
|
Tables []TableContext `json:"tables"`
|
|
}
|
|
|
|
// TableContext 表的上下文信息
|
|
type TableContext struct {
|
|
Name string `json:"name"`
|
|
Comment string `json:"comment,omitempty"`
|
|
Columns []ColumnInfo `json:"columns"`
|
|
Indexes []IndexInfo `json:"indexes,omitempty"`
|
|
SampleRows []map[string]interface{} `json:"sampleRows,omitempty"`
|
|
RowCount int64 `json:"rowCount,omitempty"`
|
|
}
|
|
|
|
// ColumnInfo 列信息
|
|
type ColumnInfo struct {
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
Nullable bool `json:"nullable"`
|
|
PrimaryKey bool `json:"primaryKey"`
|
|
Comment string `json:"comment,omitempty"`
|
|
}
|
|
|
|
// IndexInfo 索引信息
|
|
type IndexInfo struct {
|
|
Name string `json:"name"`
|
|
Columns []string `json:"columns"`
|
|
Unique bool `json:"unique"`
|
|
}
|
|
|
|
// QueryResultContext 查询结果上下文
|
|
type QueryResultContext struct {
|
|
SQL string `json:"sql"`
|
|
Columns []string `json:"columns"`
|
|
Rows []map[string]interface{} `json:"rows"`
|
|
RowCount int `json:"rowCount"`
|
|
}
|