(ctx context.Context, fullContent string, projectInstructions string, userInstructions string, conversationType chatv2.ConversationType)
| 65 | } |
| 66 | |
| 67 | func (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 | |
| 87 | func (s *ChatServiceV2) GetPrompt(ctx context.Context, content string, selectedText string, surrounding string, conversationType chatv2.ConversationType) (string, error) { |
| 88 | var tmpl *template.Template |
no test coverage detected