mirror of
https://github.com/coaidev/coai.git
synced 2025-05-19 13:00:14 +09:00
25 lines
481 B
Go
25 lines
481 B
Go
package web
|
|
|
|
import (
|
|
"chat/globals"
|
|
"chat/manager/conversation"
|
|
)
|
|
|
|
func UsingWebSegment(instance *conversation.Conversation, restart bool) []globals.Message {
|
|
segment := conversation.CopyMessage(instance.GetChatMessage(restart))
|
|
|
|
if instance.IsEnableWeb() {
|
|
segment = ChatWithWeb(segment)
|
|
}
|
|
|
|
return segment
|
|
}
|
|
|
|
func UsingWebNativeSegment(enable bool, message []globals.Message) []globals.Message {
|
|
if enable {
|
|
return ChatWithWeb(message)
|
|
} else {
|
|
return message
|
|
}
|
|
}
|