summaryrefslogtreecommitdiffhomepage
path: root/internal/message
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-12 14:49:01 +0200
committerKujtim Hoxha <[email protected]>2025-04-21 13:38:42 +0200
commit0697dcc1d9c7330d8c9d8a2be0bb94b3d46c9345 (patch)
tree9b45cabbb2c8f0195d8428445db4d8a710db7951 /internal/message
parent8d874b839db169906e18e4277cd198504018e022 (diff)
downloadopencode-0697dcc1d9c7330d8c9d8a2be0bb94b3d46c9345.tar.gz
opencode-0697dcc1d9c7330d8c9d8a2be0bb94b3d46c9345.zip
implement nested tool calls and initial setup for result metadata
Diffstat (limited to 'internal/message')
-rw-r--r--internal/message/content.go5
-rw-r--r--internal/message/message.go1
2 files changed, 5 insertions, 1 deletions
diff --git a/internal/message/content.go b/internal/message/content.go
index cd263798b..422c04f52 100644
--- a/internal/message/content.go
+++ b/internal/message/content.go
@@ -3,6 +3,8 @@ package message
import (
"encoding/base64"
"time"
+
+ "github.com/kujtimiihoxha/termai/internal/llm/models"
)
type MessageRole string
@@ -65,7 +67,6 @@ type ToolCall struct {
Name string `json:"name"`
Input string `json:"input"`
Type string `json:"type"`
- Metadata any `json:"metadata"`
Finished bool `json:"finished"`
}
@@ -75,6 +76,7 @@ type ToolResult struct {
ToolCallID string `json:"tool_call_id"`
Name string `json:"name"`
Content string `json:"content"`
+ Metadata string `json:"metadata"`
IsError bool `json:"is_error"`
}
@@ -92,6 +94,7 @@ type Message struct {
Role MessageRole
SessionID string
Parts []ContentPart
+ Model models.ModelID
CreatedAt int64
UpdatedAt int64
diff --git a/internal/message/message.go b/internal/message/message.go
index eeeb83ed2..06dae13a5 100644
--- a/internal/message/message.go
+++ b/internal/message/message.go
@@ -155,6 +155,7 @@ func (s *service) fromDBItem(item db.Message) (Message, error) {
SessionID: item.SessionID,
Role: MessageRole(item.Role),
Parts: parts,
+ Model: models.ModelID(item.Model.String),
CreatedAt: item.CreatedAt,
UpdatedAt: item.UpdatedAt,
}, nil