MCPcopy Create free account
hub / github.com/PaperDebugger/paperdebugger / MapModelPromptToProto

Function MapModelPromptToProto

internal/api/mapper/prompt.go:9–22  ·  view source on GitHub ↗
(p *models.Prompt)

Source from the content-addressed store, hash-verified

7)
8
9func MapModelPromptToProto(p *models.Prompt) *userv1.Prompt {
10 if p == nil {
11 return nil
12 }
13
14 return &userv1.Prompt{
15 Id: p.ID.Hex(),
16 CreatedAt: timestamppb.New(p.CreatedAt.Time()),
17 UpdatedAt: timestamppb.New(p.UpdatedAt.Time()),
18 Title: p.Title,
19 Content: p.Content,
20 IsUserPrompt: true,
21 }
22}
23
24func MapModelPromptsToProto(prompts []*models.Prompt) []*userv1.Prompt {
25 result := make([]*userv1.Prompt, len(prompts))

Callers 3

UpdatePromptMethod · 0.92
CreatePromptMethod · 0.92
MapModelPromptsToProtoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected