callInternal method

  1. @override
Future<ChainValues> callInternal(
  1. ChainValues inputs
)
override

Call method to be implemented by subclasses (called by call). This is where the core logic of the chain should be implemented.

Implementation

@override
Future<ChainValues> callInternal(final ChainValues inputs) async {
  final promptValue = prompt.formatPrompt(inputs);

  final response = await llm.invoke(promptValue, options: llmOptions);

  final res = outputParser == null
      ? response.output
      : await outputParser!.invoke(response);

  return {
    outputKey: res,
    if (!returnFinalOnly) fullGenerationOutputKey: response,
  };
}