package
0.0.0-20230628125949-3eebe5bfe722
Repository: https://github.com/wejick/gochain.git
Documentation: pkg.go.dev
# Packages
To use ChatStreaming, call it as go routine and then listen to the channel until it's closed
Example of ChatStreaming usage :
Chat := NewOpenAIChatModel(token,"",modelname)
streamingChannel := make(chan model.ChatMessage,100) // make it buffered
go Chat.ChatStreaming(ctx,messages, model.WithIsStreaming(true), model.WithStreamingChannel(streamingChannel))
for {
value, ok := <-streamingChannel
if ok && !model.IsStreamFinished(value) {
fmt.Print(value.Content)
} else {
fmt.Println("")
break
}
}
*/.
# Functions
No description provided by the author
IsStreamFinished check if it's the end of message.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
ChatModelMock is a mock implementation of ChatModel.
LLMModelMock is a mock implementation of LLMModel.
No description provided by the author
# Interfaces
go:generate moq -out model_chat_moq.go .
No description provided by the author
go:generate moq -out model_moq.go .