Skip to content

FunctionBackendConfig

Defined in: backend-browser/src/function.ts:84

Configuration for the function backend adapter.

TRequest = IRChatRequest

TResponse = IRChatResponse

optional estimateCost: EstimateCostFunction

Defined in: backend-browser/src/function.ts:124

Custom cost estimation function. Default: returns null.


execute: ExecuteFunction

Defined in: backend-browser/src/function.ts:89

Execute function for non-streaming requests. Required.


optional executeStream: ExecuteStreamFunction

Defined in: backend-browser/src/function.ts:95

Execute stream function for streaming requests. Optional - if not provided, streaming will not be supported.


optional fromIR: FromIRFunction<TRequest>

Defined in: backend-browser/src/function.ts:106

Custom fromIR conversion function. Default: returns request unchanged.


optional healthCheck: HealthCheckFunction

Defined in: backend-browser/src/function.ts:118

Custom health check function. Default: returns true.


optional listModels: ListModelsFunction

Defined in: backend-browser/src/function.ts:130

Custom list models function. Default: returns empty list.


optional metadata: FunctionBackendMetadata

Defined in: backend-browser/src/function.ts:100

Custom metadata for the adapter.


optional toIR: ToIRFunction<TResponse>

Defined in: backend-browser/src/function.ts:112

Custom toIR conversion function. Default: returns response unchanged with updated metadata.