@markprompt/core
Advanced tools
Comparing version 0.14.0 to 0.15.0
@@ -0,1 +1,2 @@ | ||
import type { ChatMessage } from './chat.js'; | ||
import type { PromptFeedback } from './types.js'; | ||
@@ -15,2 +16,7 @@ export interface SubmitFeedbackBody { | ||
/** | ||
* Callback when feedback is submitted. | ||
* @default undefined | ||
**/ | ||
onFeedbackSubmitted?: (feedback: PromptFeedback, messages?: ChatMessage[]) => void; | ||
/** | ||
* AbortController signal | ||
@@ -24,3 +30,3 @@ * @default undefined | ||
}; | ||
export declare function submitFeedback(feedback: SubmitFeedbackBody, projectKey: string, options?: SubmitFeedbackOptions): Promise<void>; | ||
export declare function submitFeedback(feedback: SubmitFeedbackBody, projectKey: string, messages?: ChatMessage[], options?: SubmitFeedbackOptions): Promise<void>; | ||
//# sourceMappingURL=feedback.d.ts.map |
@@ -5,3 +5,3 @@ import defaults from 'defaults'; | ||
}; | ||
export async function submitFeedback(feedback, projectKey, options) { | ||
export async function submitFeedback(feedback, projectKey, messages, options) { | ||
if (!projectKey) { | ||
@@ -14,2 +14,3 @@ throw new Error('A projectKey is required.'); | ||
}); | ||
options?.onFeedbackSubmitted?.(feedback.feedback, messages || []); | ||
try { | ||
@@ -16,0 +17,0 @@ const response = await fetch(resolvedOptions.apiUrl + `?${params}`, { |
{ | ||
"name": "@markprompt/core", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -172,2 +172,4 @@ # `@markprompt/core` | ||
- `options.apiUrl` (`string`): URL at which to post feedback | ||
- `options.onFeedbackSubmitted` (`function`): Callback function when feedback | ||
is submitted | ||
- `options.signal` (`AbortSignal`): AbortController signal | ||
@@ -174,0 +176,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45072
585
193