feat: add model name display in AI actions and optimize HTML report

- Add ModelName field to PlanningResult and SubActionResult
- Update HTML report with improved layout and model name display
- Fix elapsed time setting bug and enhance mobile responsiveness
This commit is contained in:
lilong.129
2025-06-08 22:08:51 +08:00
parent 660e8ca124
commit 14cef72f5a
7 changed files with 609 additions and 118 deletions
+5 -2
View File
@@ -32,6 +32,7 @@ type PlanningResult struct {
Thought string `json:"thought"`
Content string `json:"content"` // original content from model
Error string `json:"error,omitempty"`
ModelName string `json:"model_name"` // model name used for planning
}
func NewPlanner(ctx context.Context, modelConfig *ModelConfig) (*Planner, error) {
@@ -132,6 +133,7 @@ func (p *Planner) Call(ctx context.Context, opts *PlanningOptions) (*PlanningRes
result := &PlanningResult{
ToolCalls: message.ToolCalls,
Thought: message.Content,
ModelName: string(p.modelConfig.ModelType),
}
return result, nil
}
@@ -140,8 +142,9 @@ func (p *Planner) Call(ctx context.Context, opts *PlanningOptions) (*PlanningRes
result, err := p.parser.Parse(message.Content, opts.Size)
if err != nil {
result = &PlanningResult{
Thought: message.Content,
Error: err.Error(),
Thought: message.Content,
Error: err.Error(),
ModelName: string(p.modelConfig.ModelType),
}
log.Debug().Str("reason", err.Error()).Msg("parse content to actions failed")
}