馃 Parakeet 0.2.5 馃ェ [pie]
Release notes
v0.2.5 馃ェ [pie]
Helpers
Estimate the number of tokens in a text
content.CountTokens(text string) intcontent.CountTokensAdvanced(text string) intcontent.EstimateGPTTokens(text string) int
this could be useful to estimate the value of
num_ctx
Extract elements from source code:
source.ExtractCodeElements(fileContent string, language string) ([]CodeElement, error)
// CodeElement represents a code structure element (class, function, method)
type CodeElement struct {
Type string // "class", "function", "method"
Name string
Signature string
Description string
LineNumber int
ParentClass string // For methods
Parameters []string
Source string // Source code of the element
}the
Signaturecould be useful to add context to embeddings.
Get and cast environment variable value at the same time:
gear.GetEnvFloat(key string, defaultValue float64) float64gear.GetEnvInt(key string, defaultValue int) intgear.GetEnvString(key string, defaultValue string) string
Conversational history + new samples
In Memory
- Added
history.RemoveMessage(id string)- see example:
69-web-chat-bot
- see example:
- Added
history.SaveMessageWithSession(sessionId string, messagesCounters *map[string]int, message llm.Message)- see example:
70-web-chat-bot-with-session
- see example:
- Added
history.RemoveTopMessageOfSession(sessionId string, messagesCounters *map[string]int, conversationLength int)- see example:
70-web-chat-bot-with-session
- see example:
Bbolt Memory
- Added
history.RemoveMessage(id string) - Added
history.SaveMessageWithSession(sessionId string, messagesCounters *map[string]int, message llm.Message)- see example:
71-web-chat-bot-with-session
- see example:
- Added
history.RemoveTopMessageOfSession(sessionId string, messagesCounters *map[string]int, conversationLength int)- see example:
71-web-chat-bot-with-session
- see example: