@markprompt/core
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -27,3 +27,3 @@ import type { OpenAIModelId } from './types.js'; | ||
*/ | ||
export declare function submitPrompt(prompt: string, projectKey: string, onAnswerChunk: (answerChunk: string) => void, onReferences: (references: string[]) => void, onError: (error: Error) => void, options?: Options): Promise<void>; | ||
export declare function submitPrompt(prompt: string, projectKey: string, onAnswerChunk: (answerChunk: string) => boolean, onReferences: (references: string[]) => void, onError: (error: Error) => void, options?: Options): Promise<void>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -65,3 +65,8 @@ export const DEFAULT_MODEL = 'gpt-3.5-turbo'; | ||
else { | ||
onAnswerChunk(chunkValue); | ||
const shouldContinue = onAnswerChunk(chunkValue); | ||
if (!shouldContinue) { | ||
// If callback returns false, it means it wishes | ||
// to interrupt the streaming. | ||
done = true; | ||
} | ||
} | ||
@@ -68,0 +73,0 @@ } |
{ | ||
"name": "@markprompt/core", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
10841
111