refactor: change pointer receivers to value types for Conversation and UserMessage in various structs and functions

This commit is contained in:
mlogclub
2026-04-17 18:48:45 +08:00
parent 976b9defde
commit 51884f1bdf
22 changed files with 63 additions and 115 deletions
@@ -37,11 +37,11 @@ func init() {
}
type CreateTicketGraph struct {
conversation *models.Conversation
conversation models.Conversation
aiAgent models.AIAgent
}
func NewCreateTicketGraph(conversation *models.Conversation, aiAgent models.AIAgent) *CreateTicketGraph {
func NewCreateTicketGraph(conversation models.Conversation, aiAgent models.AIAgent) *CreateTicketGraph {
return &CreateTicketGraph{
conversation: conversation,
aiAgent: aiAgent,
@@ -49,9 +49,6 @@ func NewCreateTicketGraph(conversation *models.Conversation, aiAgent models.AIAg
}
func (g *CreateTicketGraph) Run(ctx context.Context, argumentsInJSON string) (string, error) {
if g == nil || g.conversation == nil {
return "", fmt.Errorf("create ticket graph not initialized")
}
wasInterrupted, hasState, state := componenttool.GetInterruptState[CreateTicketGraphState](ctx)
if !wasInterrupted {
req, err := g.buildCreateRequest(argumentsInJSON)