Skip to content

Commit 9e9f6d4

Browse files
committed
tool_call_id
1 parent 8683725 commit 9e9f6d4

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

agent.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ func (b *BaseAgent) handleToolCalls(toolCalls []ToolCall) error {
221221
}
222222
b.mutex.Lock()
223223
b.memory.Add(Message{
224-
Role: RoleTool,
225-
Content: r.Content,
226-
Name: r.Name,
227-
ToolID: r.CallID,
224+
Role: RoleTool,
225+
Content: r.Content,
226+
Name: r.Name,
227+
ToolCallID: r.CallID,
228228
})
229229
b.mutex.Unlock()
230230
}

llm.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ type ChatCompletionRequest struct {
3737

3838
// Message represents a chat message with standardized fields.
3939
type Message struct {
40-
Role string `json:"role"`
41-
Content string `json:"content"`
42-
Name string `json:"name,omitempty"`
43-
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
44-
ToolID string `json:"tool_id,omitempty"`
40+
Role string `json:"role"`
41+
Content string `json:"content"`
42+
Name string `json:"name,omitempty"`
43+
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
44+
ToolCallID string `json:"tool_call_id,omitempty"`
4545
}
4646

4747
// ToolCall represents a tool invocation request.

openai.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func mapToOpenAIMessages(messages []Message) []openai.ChatCompletionMessage {
5959
Role: m.Role,
6060
Name: m.Name,
6161
Content: m.Content,
62-
ToolCallID: m.ToolID,
62+
ToolCallID: m.ToolCallID,
6363
})
6464
} else {
6565
msg := openai.ChatCompletionMessage{

0 commit comments

Comments
 (0)