<commit_before>export interface ValidationError {
  field: string
  message: string
}

export class ActionResponse {

  message?: string
  refreshQuery = false
  success = true
  validationErrors?: ValidationError[] = []

  constructor(
    fields?: {
        message?: string,
        refreshQuery?: boolean,
        success?: boolean,
        validationErrors?: ValidationError[],
    }) {
    if (fields) {
      Object.assign(this, fields)
    }
  }

  asJson(): any {
    const errs: any = {}
    if (this.validationErrors) {
      for (const error of this.validationErrors) {
        errs[error.field] = error.message
      }
    }
    return {
      message: this.message,
      refresh_query: this.refreshQuery,
      success: this.success,
      validation_errors: errs,
    }
  }

}<commit_msg>ActionResponse properly sets the `looker` key (#173)<commit_after>export interface ValidationError {
  field: string
  message: string
}

export class ActionResponse {

  message?: string
  refreshQuery = false
  success = true
  validationErrors?: ValidationError[] = []

  constructor(
    fields?: {
        message?: string,
        refreshQuery?: boolean,
        success?: boolean,
        validationErrors?: ValidationError[],
    }) {
    if (fields) {
      Object.assign(this, fields)
    }
  }

  asJson(): any {
    const errs: any = {}
    if (this.validationErrors) {
      for (const error of this.validationErrors) {
        errs[error.field] = error.message
      }
    }
    return {
      looker: {
        message: this.message,
        refresh_query: this.refreshQuery,
        success: this.success,
        validation_errors: errs,
      },
    }
  }

}
{'fraction_non_alphanumeric': 0.10892857142857143, 'fraction_numerical': 0.0017857142857142857, 'mean_word_length': 2.4306122448979592, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6170830', 'n_tokens_mistral': 493, 'n_tokens_neox': 477, 'n_words': 117}