Properties
abort
abort: (() => Promise<void>)
Type declaration
- (): Promise<void>
Returns Promise<void>
api
api: { addHeader: ((key,
val) => void); csrfToken: (() => null | string); del: (<T_4>(uri,
verbose?) => Promise<ApiResponse<T_4>>); get: (<T>(uri,
verbose?) => Promise<ApiResponse<T>>); hasCsrfCookie: (() => boolean); onResponse: ((hook) => void); patch: (<T_3>(uri,
payload,
verbose?) => Promise<ApiResponse<T_3>>); post: (<T_1>(uri,
payload,
multipart?,
verbose?) => Promise<ApiResponse<T_1>>); postSse: (<T_5>(uri,
payload,
onChunk,
abortController,
parseJson?,
multipart?,
verbose?,
debug?) => Promise<void>); put: (<T_2>(uri,
payload,
verbose?) => Promise<ApiResponse<T_2>>); removeHeader: ((key) => void); setCsrfToken: ((token) => void); setCsrfTokenFromCookie: ((verbose?) => boolean); } Type declaration
addHeader: ((key, val) => void)
csrfToken: (() => null | string)
- (): null | string
Returns null | string
del: (<T_4>(uri, verbose?) => Promise<ApiResponse<T_4>>)
- <T_4>(uri, verbose?): Promise<ApiResponse<T_4>>
Parameters
- uri: string
Optional
verbose: boolean
Returns Promise<ApiResponse<T_4>>
get: (<T>(uri, verbose?) => Promise<ApiResponse<T>>)
- <T>(uri, verbose?): Promise<ApiResponse<T>>
Parameters
- uri: string
Optional
verbose: boolean
Returns Promise<ApiResponse<T>>
hasCsrfCookie: (() => boolean)
- (): boolean
Returns boolean
onResponse: ((hook) => void)
patch: (<T_3>(uri, payload, verbose?) => Promise<ApiResponse<T_3>>)
- <T_3>(uri, payload, verbose?): Promise<ApiResponse<T_3>>
Parameters
- uri: string
- payload: any[] | Record<string, any>
Optional
verbose: boolean
Returns Promise<ApiResponse<T_3>>
post: (<T_1>(uri, payload, multipart?, verbose?) => Promise<ApiResponse<T_1>>)
- <T_1>(uri, payload, multipart?, verbose?): Promise<ApiResponse<T_1>>
Parameters
- uri: string
- payload: any[] | FormData | Record<string, any>
Optional
multipart: booleanOptional
verbose: boolean
Returns Promise<ApiResponse<T_1>>
postSse: (<T_5>(uri, payload, onChunk, abortController, parseJson?, multipart?, verbose?, debug?) => Promise<void>)
- <T_5>(uri, payload, onChunk, abortController, parseJson?, multipart?, verbose?, debug?): Promise<void>
Parameters
- uri: string
- payload: any[] | FormData | Record<string, any>
- onChunk: ((payload) => void)
- (payload): void
Returns void
- abortController: AbortController
Optional
parseJson: booleanOptional
multipart: booleanOptional
verbose: booleanOptional
debug: boolean
Returns Promise<void>
put: (<T_2>(uri, payload, verbose?) => Promise<ApiResponse<T_2>>)
- <T_2>(uri, payload, verbose?): Promise<ApiResponse<T_2>>
Parameters
- uri: string
- payload: any[] | Record<string, any>
Optional
verbose: boolean
Returns Promise<ApiResponse<T_2>>
removeHeader: ((key) => void)
setCsrfToken: ((token) => void)
- (token): void
Returns void
setCsrfTokenFromCookie: ((verbose?) => boolean)
- (verbose?): boolean
Parameters
Optional
verbose: boolean
Returns boolean
infer
infer: ((prompt,
params,
parseJson?,
parseJsonFunc?) => Promise<InferenceResult>) Type declaration
- (prompt, params, parseJson?, parseJsonFunc?): Promise<InferenceResult>
Parameters
- prompt: string
- params: InferenceParams
Optional
parseJson: booleanOptional
parseJsonFunc: ((data) => Record<string, any>)- (data): Record<string, any>
Returns Record<string, any>
info
info: (() => Promise<Record<string, any>>)
Type declaration
- (): Promise<Record<string, any>>
Returns Promise<Record<string, any>>
loadModel
loadModel: ((name, ctx?) => Promise<void>)
Type declaration
- (name, ctx?): Promise<void>
Parameters
- name: string
Optional
ctx: number
Returns Promise<void>
modelsInfo
modelsInfo: (() => Promise<void>)
Type declaration
- (): Promise<void>
Returns Promise<void>
Optional
onEndEmit
onEndEmit?: ((result) => void)
Type declaration
- (result): void
Returns void
Optional
onError
onError?: ((err) => void)
Optional
onStartEmit
onStartEmit?: ((data) => void)
Optional
onToken
onToken?: ((t) => void)
serverUrl
serverUrl: string
Defines the structure and behavior of an LM Provider.
LmProvider