feat: implement core backend architecture and project management services for the History API
Build and Release / release (push) Successful in 1m33s
Build and Release / release (push) Successful in 1m33s
This commit is contained in:
+3
-2
@@ -19,6 +19,8 @@ type RagUtils struct {
|
||||
embedder *embeddings.EmbedderImpl
|
||||
}
|
||||
|
||||
var htmlTagRegex = regexp.MustCompile(`<[^>]*>`)
|
||||
|
||||
func NewRagUtils() (*RagUtils, error) {
|
||||
openRouterAPIKey, err := config.GetConfig("OPEN_ROUTER_API")
|
||||
if err != nil {
|
||||
@@ -57,8 +59,7 @@ func NewRagUtils() (*RagUtils, error) {
|
||||
}
|
||||
|
||||
func (u *RagUtils) StripHTML(text string) string {
|
||||
re := regexp.MustCompile(`<[^>]*>`)
|
||||
text = re.ReplaceAllString(text, " ")
|
||||
text = htmlTagRegex.ReplaceAllString(text, " ")
|
||||
return html.UnescapeString(text)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user