Documentation
¶
Index ¶
Constants ¶
View Source
const ( RoleDev = "dev" RoleExpert = "expert" RoleReview = "review" RoleTest = "test" )
Role constants for --role flag
View Source
const (
DeepseekChat = int64(0)
)
Variables ¶
View Source
var ( HistSizeKey = ContextKeyType[int]{"HistSize"} StartTimeKey = ContextKeyType[time.Time]{"StartTime"} StartBalanceKey = ContextKeyType[map[string]string]{"StartBalance"} CurrentModelIDKey = ContextKeyType[int64]{"CurrentModelID"} CurrentModelNameKey = ContextKeyType[string]{"CurrentModelName"} CurrentDomainIDKey = ContextKeyType[int64]{"CurrentDomainID"} CurrentRoleKey = ContextKeyType[string]{"CurrentRole"} ShellSummaryKey = ContextKeyType[string]{"ShellSummary"} ShellArgsKey = ContextKeyType[[]string]{"ShellArgs"} StreamKey = ContextKeyType[bool]{"Stream"} LeftTokensKey = ContextKeyType[int]{"LeftTokens"} FinishReasonLengthKey = ContextKeyType[bool]{"FinishReasonLength"} IsChildProcessKey = ContextKeyType[bool]{"IsChildProcess"} AINameCNKey = ContextKeyType[string]{"AINameCN"} AINameENKey = ContextKeyType[string]{"AINameEN"} AINameEmailKey = ContextKeyType[string]{"AINameEmail"} UserIDKey = ContextKeyType[string]{"UserID"} AINameBirdFrogKey = ContextKeyType[string]{"AINameBirdFrog"} GitUserNameKey = ContextKeyType[string]{"GitUserName"} GitUserEmailKey = ContextKeyType[string]{"GitUserEmail"} KeepKey = ContextKeyType[bool]{"Keep"} )
View Source
var ( WithTimeout = context.WithTimeout WithValue = context.WithValue WithCancel = context.WithCancel DeadlineExceeded = context.DeadlineExceeded Canceled = context.Canceled Background = context.Background TODO = context.TODO )
View Source
var ( ProjectRoot = GetProjectRoot() ModelDeepseekChat = config.Get("model-deepseek-chat", "deepseek-v4-flash") )
Functions ¶
func ContextValue ¶
func ContextValue[T any](ctx context.Context, k ContextKeyType[T], d T) (v T)
func GetProjectRoot ¶
func GetProjectRoot() (projectRoot string)
func GitUserEmail ¶
func GitUserEmail() string
GitUserEmail returns git config user.email, or "未知" on error.
func GitUserName ¶
func GitUserName() string
GitUserName returns git config user.name, or "未知" on error.
Types ¶
type CancelFunc ¶
type CancelFunc = context.CancelFunc
type ContextKeyType ¶
type ContextKeyType[T any] struct { // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.