forked from voideditor/void
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ef1aa2
commit aa95cea
Showing
5 changed files
with
43 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,43 @@ | ||
// void/common/sendLLMMessage.ts | ||
|
||
import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js'; | ||
import { VoidConfig } from '../../../contrib/void/browser/registerConfig.js'; | ||
|
||
|
||
|
||
export type LLMMessageAbortRef = { current: (() => void) | null } | ||
|
||
export type LLMMessageOnText = (newText: string, fullText: string) => void | ||
|
||
export type OnFinalMessage = (input: string) => void | ||
|
||
export type LLMMessage = { | ||
role: 'system' | 'user' | 'assistant'; | ||
content: string; | ||
} | ||
|
||
export type SendLLMMessageParams = { | ||
messages: LLMMessage[]; | ||
onText: LLMMessageOnText; | ||
onFinalMessage: (fullText: string) => void; | ||
onError: (error: Error | string) => void; | ||
voidConfig: VoidConfig | null; | ||
abortRef: LLMMessageAbortRef; | ||
|
||
logging: { | ||
loggingName: string, | ||
}; | ||
} | ||
|
||
|
||
|
||
export const ISendLLMMessageService = createDecorator<ISendLLMMessageService>('sendLLMMessageService'); | ||
|
||
// defines an interface that node/ creates and browser/ uses | ||
export interface ISendLLMMessageService { | ||
readonly _serviceBrand: undefined; | ||
|
||
sendLLMMessage(data: any): Promise<any>; | ||
} | ||
sendLLMMessage: (params: SendLLMMessageParams) => void; | ||
|
||
} | ||
|