FunctionBackendConfig
Defined in: backend-browser/src/function.ts:84
Configuration for the function backend adapter.
Type Parameters
Section titled “Type Parameters”TRequest
Section titled “TRequest”TRequest = IRChatRequest
TResponse
Section titled “TResponse”TResponse = IRChatResponse
Properties
Section titled “Properties”estimateCost?
Section titled “estimateCost?”
optionalestimateCost:EstimateCostFunction
Defined in: backend-browser/src/function.ts:124
Custom cost estimation function. Default: returns null.
execute
Section titled “execute”execute:
ExecuteFunction
Defined in: backend-browser/src/function.ts:89
Execute function for non-streaming requests. Required.
executeStream?
Section titled “executeStream?”
optionalexecuteStream:ExecuteStreamFunction
Defined in: backend-browser/src/function.ts:95
Execute stream function for streaming requests. Optional - if not provided, streaming will not be supported.
fromIR?
Section titled “fromIR?”
optionalfromIR:FromIRFunction<TRequest>
Defined in: backend-browser/src/function.ts:106
Custom fromIR conversion function. Default: returns request unchanged.
healthCheck?
Section titled “healthCheck?”
optionalhealthCheck:HealthCheckFunction
Defined in: backend-browser/src/function.ts:118
Custom health check function. Default: returns true.
listModels?
Section titled “listModels?”
optionallistModels:ListModelsFunction
Defined in: backend-browser/src/function.ts:130
Custom list models function. Default: returns empty list.
metadata?
Section titled “metadata?”
optionalmetadata:FunctionBackendMetadata
Defined in: backend-browser/src/function.ts:100
Custom metadata for the adapter.
optionaltoIR:ToIRFunction<TResponse>
Defined in: backend-browser/src/function.ts:112
Custom toIR conversion function. Default: returns response unchanged with updated metadata.