BidiModel<CustomOptions> constructor
BidiModel<CustomOptions> ({
- required String name,
- required InternalActionFn<
ModelRequest, ModelResponse, ModelResponseChunk, ModelRequest> fn, - Map<
String, dynamic> ? metadata, - SchemanticType<
CustomOptions> ? customOptions,
Implementation
BidiModel({
required super.name,
required super.fn,
super.metadata,
this.customOptions,
}) : super(
actionType: .bidiModel,
inputSchema: ModelRequest.$schema,
initSchema: ModelRequest.$schema,
outputSchema: ModelResponse.$schema,
streamSchema: ModelResponseChunk.$schema,
) {
metadata['description'] = name;
final model =
(metadata['model'] ??= <String, dynamic>{}) as Map<String, dynamic>;
model['label'] = name;
if (customOptions != null) {
model['customOptions'] = toJsonSchema(type: customOptions);
}
}