Documentation
¶
Index ¶
- Constants
- Variables
- func AppPath(relativePath string) string
- func AppRoot() string
- func CalculateNumCtx(text string, sessionTokens int) (response int)
- func CountryName(langTag string) string
- func CountryNameOf(countryLang, outputLang string) string
- func Decrypt(text string, key []byte) (string, error)
- func DecryptSilent(text, salt string) string
- func DecryptWithAppSalt(text, salt string) string
- func Download(url string) (data []byte, err error)
- func Encrypt(text string, key []byte) (string, error)
- func EncryptSilent(text, salt string) string
- func EncryptWithAppSalt(text string) string
- func ExtractThinkContent(text string) (thinkContent string, otherContent string)
- func FormatDate(langTag string, date time.Time) string
- func FormatTime(langTag string, date time.Time) string
- func GetDirSensyPrompts() string
- func GetError(m map[string]interface{}) (err error)
- func GormConfig(mode string) (config *gorm.Config)
- func Hash(items ...any) (response string)
- func HashSerializable(items ...gg_.ISerializable) (response string)
- func HashStrings(items ...string) (response string)
- func IsRAGRequired(textSize int) (response bool)
- func Lang(lang string) *nlp_detect.LanguageISO
- func LangCode(lang string) string
- func LangCodeDetect(text string) string
- func LangDetect(text string) *nlp_detect.LanguageISO
- func LangName(lang string) string
- func LangNameDefOut(lang string) string
- func LangNameOut(langIn, langOut string) string
- func RenderMustache(text string, context ...interface{}) (string, error)
- func Slugify(text string) (response string)
- func SplitChunks(text string, chunkSize int) []string
- func TempRoot() string
- func ToUID(sep string, args ...string) string
- func ToUIDChunkItem(uid string, sep string, index int) (response string)
- func ToUIDChunks(uid string, sep string) (response []string)
- type KnowledgeModeType
- type ProgressCallback
Constants ¶
View Source
const ( Version = "0.3.71" ModeProduction = gg.ModeProduction ModeDebug = gg.ModeDebug DefLang = "en" // default language SessionContextId = "session-context" )
View Source
const ( DocSourceVFS = "vfs" DocSourceEmail = "email" DocSourceUpload = "upload" )
View Source
const DirSensyOutputs = "./sensy-outputs" // all sensy outputs go here
View Source
const DirSensyPrompts = "./sensy-prompts" // source folder for prompts (only if used AI)
Variables ¶
View Source
var ( DefLimitTextSize = 500000 // RAG limit of text size before chunk the text DefLimitMaxAutoCalculatedTokens = 65536 // Max number of auto-calc tokens )
Functions ¶
func CalculateNumCtx ¶
CalculateNumCtx computes a numerical context value based on input text length and session tokens. Minimum response value is 2048
func CountryName ¶
func CountryNameOf ¶
func DecryptSilent ¶ added in v0.3.71
func DecryptWithAppSalt ¶ added in v0.3.71
func EncryptSilent ¶ added in v0.3.71
func EncryptWithAppSalt ¶ added in v0.3.71
func ExtractThinkContent ¶ added in v0.3.71
func GetDirSensyPrompts ¶
func GetDirSensyPrompts() string
func GormConfig ¶
func HashSerializable ¶
func HashSerializable(items ...gg_.ISerializable) (response string)
func HashStrings ¶
func IsRAGRequired ¶
func Lang ¶
func Lang(lang string) *nlp_detect.LanguageISO
func LangCodeDetect ¶
func LangDetect ¶
func LangDetect(text string) *nlp_detect.LanguageISO
func LangNameDefOut ¶
func LangNameOut ¶
func RenderMustache ¶
RenderMustache renders a Mustache template using the provided text and context, returning the rendered string or an error. If an error occurs during rendering, the original text is returned as the fallback response.
func Slugify ¶
Slugify converts the input text into a URL-friendly slug by transforming it to lowercase and replacing certain characters with "_".
func SplitChunks ¶ added in v0.3.71
func ToUIDChunks ¶
Types ¶
type KnowledgeModeType ¶
type KnowledgeModeType string
const ( ModeKnowledge KnowledgeModeType = "knowledge" ModeSession KnowledgeModeType = "session" ModeNotebook = "notebook" )
type ProgressCallback ¶
Click to show internal directories.
Click to hide internal directories.