Skip to content

Commit 58f8abd

Browse files
committed
fix: enhance completion method parameters to include reasoning effort and event callback
1 parent 3c19f72 commit 58f8abd

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

adminforth/types/adapters/CompletionAdapter.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
export type CompletionStreamEvent = {
2+
type: "output" | "reasoning";
3+
delta: string;
4+
text: string;
5+
source?: "summary" | "text";
6+
};
17
export interface CompletionAdapter {
28

39
/**
@@ -11,14 +17,19 @@ export interface CompletionAdapter {
1117
* @param content - The input text to complete
1218
* @param maxTokens - The maximum number of tokens to generate
1319
* @param outputSchema - Optional structured output schema for the response
14-
* @param onChunk - Optional callback invoked for each streamed chunk
20+
* @param reasoningEffort - Optional parameter to indicate the level of reasoning effort for the completion
21+
* @param onChunk - Optional callback invoked for each streamed chunk or reasoning event
1522
* @returns A promise that resolves to an object containing the completed text and other metadata
1623
*/
1724
complete(
1825
content: string,
1926
maxTokens: number,
2027
outputSchema?: any,
21-
onChunk?: (chunk: string) => void | Promise<void>,
28+
reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh',
29+
onChunk?: (
30+
chunk: string,
31+
event?: CompletionStreamEvent,
32+
) => void | Promise<void>,
2233
): Promise<{
2334
content?: string;
2435
finishReason?: string;

0 commit comments

Comments
 (0)