Documentation
¶
Index ¶
- Constants
- func BoundToolFeedback(value string) string
- func BuildSystemPrompt(dbType string, schemaInfo *db.SchemaInfo, catalog string) string
- func FormatDBName(dbType string) string
- type AIResponse
- type ChatMessage
- type Client
- type ResponseType
- type SQLResponse
- type Service
- func (s *Service) ChatCompletion(ctx context.Context, messages []ChatMessage) (*AIResponse, *errors.XError)
- func (s *Service) GenerateResponse(ctx context.Context, userPrompt string, schemaInfo *db.SchemaInfo, ...) (*AIResponse, *errors.XError)
- func (s *Service) GenerateSQL(ctx context.Context, userPrompt string, schemaInfo *db.SchemaInfo, ...) (*AIResponse, *errors.XError)
- type ToolAction
Constants ¶
View Source
const MaxToolFeedbackRunes = 4096
View Source
const SystemPromptTemplate = `` /* 1157-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func BoundToolFeedback ¶
BoundToolFeedback limits locally computed tool output before it is sent to the remote model. The complete output remains available in the local TUI.
func BuildSystemPrompt ¶
func BuildSystemPrompt(dbType string, schemaInfo *db.SchemaInfo, catalog string) string
func FormatDBName ¶
Types ¶
type AIResponse ¶
type AIResponse struct {
Type ResponseType `json:"type"`
SQL string `json:"sql,omitempty"`
JSCode string `json:"js_code,omitempty"`
DatasetID string `json:"dataset_id,omitempty"`
Format string `json:"format,omitempty"`
FilePath string `json:"filepath,omitempty"`
Content string `json:"content,omitempty"`
Explanation string `json:"explanation"`
Actions []ToolAction `json:"actions,omitempty"`
}
type ChatMessage ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ChatCompletion ¶
func (c *Client) ChatCompletion(ctx context.Context, messages []ChatMessage) (*AIResponse, *errors.XError)
type ResponseType ¶
type ResponseType string
const ( TypeSQL ResponseType = "sql" TypeJS ResponseType = "js" TypeExport ResponseType = "export" TypeReport ResponseType = "report" TypeText ResponseType = "text" )
type SQLResponse ¶
type SQLResponse = AIResponse
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ChatCompletion ¶
func (s *Service) ChatCompletion(ctx context.Context, messages []ChatMessage) (*AIResponse, *errors.XError)
func (*Service) GenerateResponse ¶
func (*Service) GenerateSQL ¶
func (s *Service) GenerateSQL(ctx context.Context, userPrompt string, schemaInfo *db.SchemaInfo, dbType string) (*AIResponse, *errors.XError)
type ToolAction ¶ added in v1.20.1
type ToolAction struct {
ID string `json:"id,omitempty"`
Type ResponseType `json:"type"`
SQL string `json:"sql,omitempty"`
JSCode string `json:"js_code,omitempty"`
DatasetID string `json:"dataset_id,omitempty"`
Format string `json:"format,omitempty"`
FilePath string `json:"filepath,omitempty"`
Content string `json:"content,omitempty"`
Explanation string `json:"explanation,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.