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

Method GetSystemPromptV2

internal/services/chat_v2.go:67–85  ·  view source on GitHub ↗
(ctx context.Context, fullContent string, projectInstructions string, userInstructions string, conversationType chatv2.ConversationType)

Source from the content-addressed store, hash-verified

65}
66
67func (s *ChatServiceV2) GetSystemPromptV2(ctx context.Context, fullContent string, projectInstructions string, userInstructions string, conversationType chatv2.ConversationType) (string, error) {
68 var tmpl *template.Template
69 switch conversationType {
70 case chatv2.ConversationType_CONVERSATION_TYPE_DEBUG:
71 tmpl = systemPromptDebugTmplV2
72 default:
73 tmpl = systemPromptDefaultTmplV2
74 }
75
76 var systemPromptBuffer bytes.Buffer
77 if err := tmpl.Execute(&systemPromptBuffer, map[string]string{
78 "FullContent": fullContent,
79 "ProjectInstructions": projectInstructions,
80 "UserInstructions": userInstructions,
81 }); err != nil {
82 return "", err
83 }
84 return strings.TrimSpace(systemPromptBuffer.String()), nil
85}
86
87func (s *ChatServiceV2) GetPrompt(ctx context.Context, content string, selectedText string, surrounding string, conversationType chatv2.ConversationType) (string, error) {
88 var tmpl *template.Template

Callers 1

createConversationMethod · 0.80

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected