diff --git a/internal/version/VERSION b/internal/version/VERSION index f46b7461..9a5d9eb6 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-beta-2505260905 +v5.0.0-beta-2505260928 diff --git a/uixt/ai/planner.go b/uixt/ai/planner.go index ea1467c0..210dd19a 100644 --- a/uixt/ai/planner.go +++ b/uixt/ai/planner.go @@ -2,6 +2,7 @@ package ai import ( "context" + "fmt" "time" "github.com/cloudwego/eino-ext/components/model/openai" @@ -113,10 +114,15 @@ func (p *Planner) Call(ctx context.Context, opts *PlanningOptions) (*PlanningRes // handle tool calls if len(message.ToolCalls) > 0 { // append tool call message + toolCallID := "" + for _, toolCall := range message.ToolCalls { + toolCallID += toolCall.ID + } p.history.Append(&schema.Message{ - Role: schema.Tool, - Content: message.Content, - ToolCalls: message.ToolCalls, + Role: schema.Tool, + Content: message.Content, + ToolCalls: message.ToolCalls, + ToolCallID: toolCallID, }) // history will be appended with tool calls execution result result := &PlanningResult{ @@ -140,11 +146,12 @@ func (p *Planner) Call(ctx context.Context, opts *PlanningOptions) (*PlanningRes Content: message.Content, }) } else { - // append tool call message + // append assistant message with tool calls p.history.Append(&schema.Message{ - Role: schema.Tool, - Content: result.Content, - ToolCalls: result.ToolCalls, + Role: schema.Tool, + Content: result.Content, + ToolCalls: result.ToolCalls, + ToolCallID: fmt.Sprintf("%d", time.Now().Unix()), }) } diff --git a/uixt/ai/session.go b/uixt/ai/session.go index ffb3f218..1c2fbaa7 100644 --- a/uixt/ai/session.go +++ b/uixt/ai/session.go @@ -98,7 +98,7 @@ func logRequest(messages ConversationHistory) { } func logResponse(message *schema.Message) { - logger := log.Info().Str("role", string(message.Role)). + logger := log.Debug().Str("role", string(message.Role)). Str("content", message.Content) var toolCalls []string