Module: helpers/ipc/sdk/assistant
Table of contents
Variables
Functions
- chatCompletion
- createChatLabelPrompt
- createSystemPrompt
- createSystemPrompt2
- createVectorSearchPrompt
- createWorkflow
- cropCaptainData
- cropIncompleteImageTag
- extendCaptainData
- getAssistant
- getProvider
- replaceCaptainData
- streamWithTools
- tools
Variables
PATH_PLACEHOLDER
• Const
PATH_PLACEHOLDER: "c:/users/anon/"
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:42 (opens in a new tab)
STORE_CATEGORIES
• Const
STORE_CATEGORIES: readonly ["image"
, "story"
, "app"
]
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:349 (opens in a new tab)
assistantStore
• Const
assistantStore: default
<Record
<string
, ChatModel
>>
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:38 (opens in a new tab)
Functions
chatCompletion
▸ chatCompletion(«destructured»
): Promise
<string
>
Parameters
Name | Type |
---|---|
«destructured» | Object |
› messages | CoreMessage [] |
› model | LanguageModelV1 |
› system | undefined | string |
› onStep? | (_partialResponse : string ) => void |
Returns
Promise
<string
>
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:221 (opens in a new tab)
createChatLabelPrompt
▸ createChatLabelPrompt(): string
Returns
string
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:67 (opens in a new tab)
createSystemPrompt
▸ createSystemPrompt(«destructured»
): string
Parameters
Name | Type |
---|---|
«destructured» | Object |
› model | string |
› provider | string |
Returns
string
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:71 (opens in a new tab)
createSystemPrompt2
▸ createSystemPrompt2(«destructured»
): string
Parameters
Name | Type |
---|---|
«destructured» | Object |
› model | string |
› provider | string |
Returns
string
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:156 (opens in a new tab)
createVectorSearchPrompt
▸ createVectorSearchPrompt(«destructured»
): string
Parameters
Name | Type |
---|---|
«destructured» | Object |
› dataTypes | string [] |
Returns
string
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:63 (opens in a new tab)
createWorkflow
▸ createWorkflow(«destructured»
): NodeChain
Parameters
Name | Type | Default value |
---|---|---|
«destructured» | Object | undefined |
› cfg? | number | 7 |
› checkpointName? | string | undefined |
› height | number | undefined |
› loraName? | string | undefined |
› loraWeight? | number | 1 |
› negativePrompt? | string | "" |
› prompt? | string | "" |
› seed? | number | 1234 |
› steps? | number | 20 |
› width | number | undefined |
Returns
NodeChain
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:249 (opens in a new tab)
cropCaptainData
▸ cropCaptainData(filePath
): string
Parameters
Name | Type |
---|---|
filePath | string |
Returns
string
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:44 (opens in a new tab)
cropIncompleteImageTag
▸ cropIncompleteImageTag(markdown
): string
Parameters
Name | Type |
---|---|
markdown | string |
Returns
string
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:351 (opens in a new tab)
extendCaptainData
▸ extendCaptainData(content
): string
Parameters
Name | Type |
---|---|
content | string |
Returns
string
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:49 (opens in a new tab)
getAssistant
▸ getAssistant(model
): null
| OpenAIProvider
| AnthropicProvider
| MistralProvider
| GoogleGenerativeAIProvider
Parameters
Name | Type |
---|---|
model | string |
Returns
null
| OpenAIProvider
| AnthropicProvider
| MistralProvider
| GoogleGenerativeAIProvider
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:586 (opens in a new tab)
getProvider
▸ getProvider(model
): "Anthropic"
| "Mistral"
| "Google"
| "Open AI"
| "Unknown"
Parameters
Name | Type |
---|---|
model | string |
Returns
"Anthropic"
| "Mistral"
| "Google"
| "Open AI"
| "Unknown"
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:617 (opens in a new tab)
replaceCaptainData
▸ replaceCaptainData(content
): string
Parameters
Name | Type |
---|---|
content | string |
Returns
string
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:56 (opens in a new tab)
streamWithTools
▸ streamWithTools<TOOLS
>(assistant
, «destructured»
): Promise
<string
>
Type parameters
Name | Type |
---|---|
TOOLS | extends Record <string , CoreTool <any , any >> |
Parameters
Name | Type |
---|---|
assistant | OpenAIProvider | AnthropicProvider | MistralProvider | GoogleGenerativeAIProvider |
«destructured» | Object |
› history | CoreMessage [] |
› model | string |
› tools | TOOLS |
› onStream | (response : string ) => void |
Returns
Promise
<string
>
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:642 (opens in a new tab)
tools
▸ tools(appId
, send?
): Object
Parameters
Name | Type |
---|---|
appId | string |
send? | <T>(action : string , payload : T ) => void |
Returns
Object
Name | Type |
---|---|
textToImage | CoreTool <ZodObject <{ dimensions : ZodDefault <ZodObject <{ height : ZodNumber ; width : ZodNumber }, "strip" , ZodTypeAny , { height : number ; width : number }, { height : number ; width : number }>> ; prompt : ZodString ; seed : ZodDefault <ZodNumber > }, "strip" , ZodTypeAny , { dimensions : { height : number ; width : number } ; prompt : string ; seed : number }, { dimensions : undefined | { height : number ; width : number } ; prompt : string ; seed : undefined | number }>, { error : string ; filePath? : undefined ; height : undefined ; prompt : undefined ; seed : undefined ; width : undefined } | { error? : undefined = message; filePath : string ; height : number ; prompt : string ; seed : number ; width : number }> & {} |
vectorSearch | CoreTool <ZodObject <{ categories : ZodArray <ZodEnum <["image" , "story" , "app" ]>, "many" > ; query : ZodString }, "strip" , ZodTypeAny , { categories : ("app" | "image" | "story" )[] ; query : string }, { categories : ("app" | "image" | "story" )[] ; query : string }>, { error? : undefined = message; matches : ({ filePath : unknown } | { filePath : unknown } | { filePath : unknown } | { filePath : unknown })[] } | { error : string = message; matches? : undefined }> & {} |
Defined in
src/electron/helpers/ipc/sdk/assistant.ts:380 (opens in a new tab)