<commit_before>import {
  GeneratorOptions,
  GeneratorProcess,
  GeneratorManifest,
  BinaryPaths,
} from '@prisma/generator-helper'

export class Generator {
  private generatorProcess: GeneratorProcess
  public manifest: GeneratorManifest | null = null
  public options?: GeneratorOptions
  constructor(private executablePath: string) {
    this.generatorProcess = new GeneratorProcess(this.executablePath)
  }
  async init() {
    await this.generatorProcess.init()
    this.manifest = await this.generatorProcess.getManifest()
  }
  stop() {
    this.generatorProcess.stop()
  }
  generate(): Promise<any> {
    if (!this.options) {
      throw new Error(
        `Please first run .setOptions() on the Generator to initialize the options`,
      )
    }<commit_msg>add debugging for Photon Go :heart:<commit_after>import {
  GeneratorOptions,
  GeneratorProcess,
  GeneratorManifest,
  BinaryPaths,
} from '@prisma/generator-helper'
import Debug from 'debug'

export class Generator {
  private generatorProcess: GeneratorProcess
  private debug: Debug.Debugger
  public manifest: GeneratorManifest | null = null
  public options?: GeneratorOptions
  constructor(private executablePath: string) {
    this.generatorProcess = new GeneratorProcess(this.executablePath)
    this.debug = Debug(`Generator:${executablePath}`)
  }
  async init() {
    await this.generatorProcess.init()
    this.debug(`Sending "getManifest" rpc to generator`)
    this.manifest = await this.generatorProcess.getManifest()
  }
  stop() {
    this.generatorProcess.stop()
  }
  generate(): Promise<any> {
    if (!this.options) {
      throw new Error(
        `Please first run .setOptions() on the Generator to initialize the options`,
      )
    }
    this.debug(`Sending "generate" rpc to generator`)
{'fraction_non_alphanumeric': 0.09848908785674315, 'fraction_numerical': 0.0, 'mean_word_length': 4.022471910112359, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5414563', 'n_tokens_mistral': 506, 'n_tokens_neox': 499, 'n_words': 132}