appendGraphViewRound folds the graph render into the conversation so the model can produce a short natural-language confirmation as its final answer.
(history []models.Message, prompt, callJSON, result string)
| 115 | // appendGraphViewRound folds the graph render into the conversation so the model |
| 116 | // can produce a short natural-language confirmation as its final answer. |
| 117 | func appendGraphViewRound(history []models.Message, prompt, callJSON, result string) ([]models.Message, string) { |
| 118 | next := make([]models.Message, 0, len(history)+2) |
| 119 | next = append(next, history...) |
| 120 | next = append(next, |
| 121 | models.Message{Role: "user", Content: prompt}, |
| 122 | models.Message{Role: "assistant", Content: "[graphview call] " + callJSON}, |
| 123 | ) |
| 124 | followup := "graphview result:\n" + result + |
| 125 | "\n\nThe interactive graph has been generated (and opened if a display is available). " + |
| 126 | "Briefly confirm to the user what was visualized and where the file is. Do not call graphview again." |
| 127 | return next, followup |
| 128 | } |
| 129 | |
| 130 | // chatGraphViewXMLInstruction is appended to the decision-turn prompt for |
| 131 | // providers WITHOUT native tools. It overrides the tool-less framing for this |
no outgoing calls