Skip to content

Commit

Permalink
update marshell
Browse files Browse the repository at this point in the history
  • Loading branch information
developerkunal committed Dec 20, 2024
1 parent 1307e1a commit 5f06ba2
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions management/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,28 +454,18 @@ type PromptRendering struct {

// MarshalJSON implements a custom [json.Marshaler].
func (c *PromptRendering) MarshalJSON() ([]byte, error) {
copyPromptRendering := *c

if c.RenderingMode != nil && *c.RenderingMode == RenderingModeStandard {
return json.Marshal(&PromptRendering{
RenderingMode: c.RenderingMode,
ContextConfiguration: nil,
DefaultHeadTagsDisabled: nil,
HeadTags: nil,
Tenant: nil,
Prompt: nil,
Screen: nil,
})
copyPromptRendering.ContextConfiguration = nil
copyPromptRendering.DefaultHeadTagsDisabled = nil
copyPromptRendering.HeadTags = nil
}
copyPromptRendering.Tenant = nil
copyPromptRendering.Prompt = nil
copyPromptRendering.Screen = nil

return json.Marshal(&PromptRendering{
RenderingMode: c.RenderingMode,
ContextConfiguration: c.ContextConfiguration,
DefaultHeadTagsDisabled: c.DefaultHeadTagsDisabled,
HeadTags: c.HeadTags,
Tenant: nil,
Prompt: nil,
Screen: nil,
})
return json.Marshal(&copyPromptRendering)
}

// MarshalJSON implements a custom [json.Marshaler].
Expand Down

0 comments on commit 5f06ba2

Please sign in to comment.