package
0.0.0-20231028044432-31312e109251
Repository: https://github.com/wejick/gchain.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
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
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.
FunctionDefinition is to describe function to model currently only being supported by few openAI's Model.
No description provided by the author
LLMModelMock is a mock implementation of LLMModel.
No description provided by the author
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 .
# Type aliases
No description provided by the author