MCPcopy
hub / github.com/promptfoo/promptfoo / sendFeedback

Function sendFeedback

src/feedback.ts:11–37  ·  view source on GitHub ↗
(feedback: string)

Source from the content-addressed store, hash-verified

9 * Send feedback to the promptfoo API
10 */
11export async function sendFeedback(feedback: string) {
12 if (!feedback.trim()) {
13 return;
14 }
15
16 try {
17 const resp = await fetchWithProxy('https://api.promptfoo.dev/api/feedback', {
18 method: 'POST',
19 headers: {
20 'Content-Type': 'application/json',
21 },
22 body: JSON.stringify({
23 message: feedback,
24 }),
25 });
26
27 if (resp.ok) {
28 logger.info(chalk.green('Feedback sent. Thank you!'));
29 } else {
30 logger.info(
31 chalk.yellow('Failed to send feedback. Please try again or open an issue on GitHub.'),
32 );
33 }
34 } catch {
35 logger.error('Network error while sending feedback');
36 }
37}
38
39/**
40 * Gather and send user feedback

Callers 2

feedback.test.tsFile · 0.90
gatherFeedbackFunction · 0.85

Calls 2

fetchWithProxyFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…