tui: add tool rendering
cleaned up message rendering and changed cache semantics other smaller tweaks
This commit is contained in:
@@ -50,8 +50,8 @@ func (m *MessageRole) IsAssistant() bool {
|
||||
}
|
||||
|
||||
// FriendlyRole returns a human friendly signifier for the message's role.
|
||||
func (m *MessageRole) FriendlyRole() string {
|
||||
switch *m {
|
||||
func (m MessageRole) FriendlyRole() string {
|
||||
switch m {
|
||||
case MessageRoleUser:
|
||||
return "You"
|
||||
case MessageRoleSystem:
|
||||
@@ -63,6 +63,6 @@ func (m *MessageRole) FriendlyRole() string {
|
||||
case MessageRoleToolResult:
|
||||
return "Tool Result"
|
||||
default:
|
||||
return string(*m)
|
||||
return string(m)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ type ToolParameter struct {
|
||||
}
|
||||
|
||||
type ToolCall struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Parameters map[string]interface{} `json:"parameters"`
|
||||
ID string `json:"id" yaml:"-"`
|
||||
Name string `json:"name" yaml:"tool"`
|
||||
Parameters map[string]interface{} `json:"parameters" yaml:"parameters"`
|
||||
}
|
||||
|
||||
type ToolCalls []ToolCall
|
||||
@@ -51,9 +51,9 @@ func (tc ToolCalls) Value() (driver.Value, error) {
|
||||
}
|
||||
|
||||
type ToolResult struct {
|
||||
ToolCallID string `json:"toolCallID"`
|
||||
ToolName string `json:"toolName,omitempty"`
|
||||
Result string `json:"result,omitempty"`
|
||||
ToolCallID string `json:"toolCallID" yaml:"-"`
|
||||
ToolName string `json:"toolName,omitempty" yaml:"tool"`
|
||||
Result string `json:"result,omitempty" yaml:"result"`
|
||||
}
|
||||
|
||||
type ToolResults []ToolResult
|
||||
|
||||
Reference in New Issue
Block a user