mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 10:26:53 +02:00
display messages
This commit is contained in:
parent
15af558423
commit
a250c2cb13
2 changed files with 20 additions and 23 deletions
16
cmd/cmd.go
16
cmd/cmd.go
|
@ -364,6 +364,22 @@ func RunHandler(cmd *cobra.Command, args []string) error {
|
|||
opts.ParentModel = info.Details.ParentModel
|
||||
|
||||
if interactive {
|
||||
if err := loadModel(cmd, &opts); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, msg := range info.Messages {
|
||||
switch msg.Role {
|
||||
case "user":
|
||||
fmt.Printf(">>> %s\n", msg.Content)
|
||||
case "assistant":
|
||||
state := &displayResponseState{}
|
||||
displayResponse(msg.Content, opts.WordWrap, state)
|
||||
fmt.Println()
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
|
||||
return generateInteractive(cmd, opts)
|
||||
}
|
||||
return generate(cmd, opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue