code: def test_eval_json_langchain():
      base_model = "llama"
      user_path = make_user_path_test()
  
      # make 2 rows of json
      prompts = [
          dict(
              instruction="What is Whisper?",
              response="""According to the document sources provided in the context, Whisper is a large language model (LLM) that can be used for various tasks such as text-to-speech (TTS), voice cloning, and speech recognition (ASR). It is a powerful tool for generating human-like speech and can be trained on a wide range of data sources.""",
          ),
          dict(
              instruction="Who made Whisper?",
              response="""According to the document sources provided within the context, Whisper was made by OpenAI.""",
          ),
      ]
      eval_prompts_only_num = len(prompts)
      eval_filename = "test_prompts.json"
      remove(eval_filename)
      import json
  
      with open(eval_filename, "wt") as f:
          f.write(json.dumps(prompts, indent=2))
  
      import pandas as pd
      from src.evaluate_params import (
          eval_func_param_names,
          eval_extra_columns,
      )
      from src.gen import main
  
      kwargs = dict(
          stream_output=False,
          langchain_mode="UserData",
          user_path=user_path,
      )
      eval_out_filename = main(
          base_model=base_model,
          gradio=False,
          eval_filename=eval_filename,
          eval_prompts_only_num=eval_prompts_only_num,
          eval_as_output=False,
          asr_model="",
          answer_with_sources=False,
          show_link_in_sources=False,
          append_sources_to_answer=False,
          append_sources_to_chat=False,
          eval_prompts_only_seed=1235,
          score_model="OpenAssistant/reward-model-deberta-v3-large-v2",
          **kwargs,
      )
      df = pd.read_parquet(eval_out_filename)
      assert df.shape[0] == 2
      columns = eval_func_param_names + eval_extra_columns
      assert df.shape[1] == len(columns)
      print(df.values)
      actuals = [
          dict(
              score=df["score"].values[ii],
              response=df["response"].values[ii],
          )
          for ii in range(df.shape[0])
      ]
      expecteds = [0.05, 0.01]
  
      for prompt, expected, actual in zip(prompts, expecteds, actuals):
          import numpy as np
  
          print("actual: %s" % actual)
          print("expected: %s" % expected)
          assert actual["score"] > expected, "Assert: %s %s" % (
              actual,
              expected,
          )
  
          from sacrebleu.metrics import BLEU
  
          bleu = BLEU()
          assert (
              bleu.sentence_score(
                  actual["response"], [prompt["response"]]
              ).score
              > 25
          )
  
file_path: h2ogpt/tests/test_eval.py
imports: import pandas
  import pytest
  from tests.utils import wrap_test_forked, make_user_path_test
  from src.enums import DocumentSubset, LangChainAction, docs_joiner_default
  from src.utils import remove
label_desc: Use image node_id 4 for calling a global function with example usage: test_eval_json_langchain() without return types