BidiModel<CustomOptions> constructor

BidiModel<CustomOptions>({
  1. required String name,
  2. required InternalActionFn<ModelRequest, ModelResponse, ModelResponseChunk, ModelRequest> fn,
  3. Map<String, dynamic>? metadata,
  4. 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);
  }
}