mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-06 07:57:27 +08:00
fix: remove redundant message cleaning logic in callModelWithLogging
The previous message cleaning logic was flawed: - cleanedMsg.Content was already set to message.Content - The condition checked if message.Content == "" then set cleanedMsg.Content = "" - This was redundant since cleanedMsg.Content would already be empty The real fix for the API 400 error is in planner.go where we ensure Tool messages have non-empty content. The utils.go changes were unnecessary.
This commit is contained in:
+1
-1
@@ -166,7 +166,7 @@ func (p *Planner) Plan(ctx context.Context, opts *PlanningOptions) (result *Plan
|
||||
Error: err.Error(),
|
||||
ModelName: string(p.modelConfig.ModelType),
|
||||
}
|
||||
log.Debug().Str("reason", err.Error()).Msg("parse content to actions failed")
|
||||
log.Warn().Str("reason", err.Error()).Msg("parse content to actions failed")
|
||||
}
|
||||
// append assistant message (since we're parsing content, not using native function calling)
|
||||
p.history.Append(&schema.Message{
|
||||
|
||||
Reference in New Issue
Block a user