renderToolCallTitle renders a title for a tool call. Should be followed by a call to render a markdown representation of the tool call's content.
(w io.Writer, cs *iostreams.ColorScheme, toolName, title string)
| 411 | // renderToolCallTitle renders a title for a tool call. Should be followed by a |
| 412 | // call to render a markdown representation of the tool call's content. |
| 413 | func renderToolCallTitle(w io.Writer, cs *iostreams.ColorScheme, toolName, title string) { |
| 414 | // Should not happen, but if it does we still want to print a heading |
| 415 | // with the information we do have. |
| 416 | if toolName == "" { |
| 417 | toolName = "Generic tool call" |
| 418 | } |
| 419 | |
| 420 | if title != "" { |
| 421 | title = cs.Bold(title) |
| 422 | } |
| 423 | |
| 424 | if title != "" { |
| 425 | fmt.Fprintf(w, "%s: %s\n", toolName, title) |
| 426 | } else { |
| 427 | fmt.Fprintf(w, "%s\n", toolName) |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | // genericToolCallNamesToTitles maps known generic tool call identifiers to human-friendly titles. |
| 432 | var genericToolCallNamesToTitles = map[string]string{ |
no test coverage detected