Documentation / @agentick/core / EngineModel
Interface: EngineModel<TModelInput, TModelOutput> ​
Defined in: core/src/model/model.ts:52
EngineModel is the primary interface for models. All models (created via createAdapter) conform to this interface.
Example ​
import { createAdapter } from '@agentick/core/model';
const model = createAdapter({
metadata: { id: 'my-model', provider: 'my-provider', capabilities: [] },
prepareInput: (input) => ({ ... }),
mapChunk: (chunk) => ({ type: 'text', delta: chunk.text }),
execute: (input) => provider.generate(input),
executeStream: (input) => provider.stream(input),
});Extended by ​
Type Parameters ​
TModelInput ​
TModelInput = ModelInput
TModelOutput ​
TModelOutput = ModelOutput
Properties ​
embed? ​
optionalembed:Procedure<(input) =>Promise<EmbedResult>,false>
Defined in: core/src/model/model.ts:69
Generate embeddings (optional — only available on models with embedding support)
fromEngineState()? ​
optionalfromEngineState: (input) =>Promise<TModelInput>
Defined in: core/src/model/model.ts:63
Convert engine state (COMInput) to model input
Parameters ​
input ​
Returns ​
Promise<TModelInput>
generate ​
generate:
Procedure<(input) =>Promise<TModelOutput>>
Defined in: core/src/model/model.ts:57
Generate a response (non-streaming)
metadata ​
metadata:
ModelMetadata
Defined in: core/src/model/model.ts:54
Model metadata (id, description, capabilities, etc.)
stream? ​
optionalstream:Procedure<(input) =>AsyncIterable<StreamEvent>,false>
Defined in: core/src/model/model.ts:60
Generate a streaming response
toEngineState()? ​
optionaltoEngineState: (output) =>Promise<EngineResponse>
Defined in: core/src/model/model.ts:66
Convert model output to engine response
Parameters ​
output ​
TModelOutput
Returns ​
Promise<EngineResponse>