Merge pull request #967 from trheyi/main
Enhance Context struct by adding Locale and Theme fields
This commit is contained in:
commit
d8e7560ff7
1 changed files with 33 additions and 21 deletions
|
|
@ -22,15 +22,21 @@ type Context struct {
|
|||
Namespace string `json:"namespace,omitempty"`
|
||||
Config map[string]interface{} `json:"config,omitempty"`
|
||||
Signal interface{} `json:"signal,omitempty"`
|
||||
|
||||
Locale string `json:"locale,omitempty"` // Locale
|
||||
Theme string `json:"theme,omitempty"` // Theme
|
||||
|
||||
Silent bool `json:"silent,omitempty"` // Silent mode
|
||||
ClientType string `json:"client_type,omitempty"` // The request client type. SDK, Desktop, Web, JSSDK, etc. the default is Web
|
||||
HistoryVisible bool `json:"history_visible,omitempty"` // History visible, default is true, if false, the history will not be displayed in the UI
|
||||
Retry bool `json:"retry,omitempty"` // Retry mode
|
||||
RetryTimes uint8 `json:"retry_times,omitempty"` // Retry times
|
||||
Upload *FileUpload `json:"upload,omitempty"`
|
||||
Upload *FileUpload `json:"upload,omitempty"` // Will be removed in the future
|
||||
|
||||
Vision bool `json:"vision,omitempty"` // Vision support
|
||||
Search bool `json:"search,omitempty"` // Search support
|
||||
RAG bool `json:"rag,omitempty"` // RAG support
|
||||
|
||||
Args []interface{} `json:"args,omitempty"` // Arguments for call
|
||||
SharedSpace plan.Space `json:"-"` // Shared space
|
||||
}
|
||||
|
|
@ -244,5 +250,11 @@ func (ctx *Context) Map() map[string]interface{} {
|
|||
data["upload"] = ctx.Upload
|
||||
}
|
||||
|
||||
// Locale
|
||||
data["locale"] = ctx.Locale
|
||||
|
||||
// Theme
|
||||
data["theme"] = ctx.Theme
|
||||
|
||||
return data
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue