Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChatHistory ¶
type ChatHistory []*ChatHistoryItem
type ChatHistoryItem ¶
type OllamaChat ¶
func NewOllamaChat ¶
func NewOllamaChat(url string) (*OllamaChat, error)
func (*OllamaChat) Prompt ¶
func (ollama *OllamaChat) Prompt(history ChatHistory, onSentence func(string), onToken func(string)) (*ChatHistoryItem, error)
type RequestBody ¶
type RequestBody struct {
Model string `json:"model"`
Messages ChatHistory `json:"messages"`
Stream bool `json:"stream"`
}
type ResponseBody ¶
type ResponseBody struct {
Model string `json:"model"`
Message ChatHistoryItem `json:"message"`
Done bool `json:"done"`
}
Click to show internal directories.
Click to hide internal directories.