Knowtation web client
    Preparing search index...

    Function runAndWait

    • Start a run and poll until it is done or failed, reporting each status.

      Parameters

      • datasetId: string
      • body: {
            llm_key?: "server" | "own" | null;
            llm_model?: string | null;
            llm_refresh: boolean;
            policy?: { name: string; version?: string | null } | null;
            rule_set?: { name: string; version?: string | null } | null;
            rule_sets?: { name: string; version?: string | null }[] | null;
            start_fresh: boolean;
        }
        • Optionalllm_key?: "server" | "own" | null

          Llm Key

          Who pays: the server's keys (needs the admin's switch) or your own key. Empty means the server's.

        • Optionalllm_model?: string | null

          Llm Model

          A Pydantic AI model string (anthropic:…, openai:…, google:…, ollama:), 'default' for the server's default model, or empty for rules only.

        • llm_refresh: boolean

          Llm Refresh

          Ask the LLM again instead of using stored answers.

          false
          
        • Optionalpolicy?: { name: string; version?: string | null } | null
        • Optionalrule_set?: { name: string; version?: string | null } | null

          One rule set (older form).

        • Optionalrule_sets?: { name: string; version?: string | null }[] | null

          Rule Sets

          Exactly these rule sets, in order; no automatic selection.

        • start_fresh: boolean

          Start Fresh

          Ignore earlier reviews: build the version from the rules alone. By default a run keeps the values people accepted or edited in the latest version.

          false
          
      • onStatus: (s: string) => void

      Returns Promise<
          {
              archived_at?: string
              | null;
              archived_by?: string | null;
              created_at: string;
              dataset_id: string;
              error?: string | null;
              finished_at?: string | null;
              id: string;
              progress?: { cached: number; done: number; total: number } | null;
              record?:
                  | {
                      dataset_hash?: string
                      | null;
                      finished_at?: string | null;
                      id: string;
                      llm_model?: string | null;
                      llm_usage?:
                          | {
                              cached_calls?: number
                              | null;
                              calls?: number | null;
                              cost_usd?: number | null;
                              input_tokens?: number | null;
                              output_tokens?: number | null;
                              saved_input_tokens?: number | null;
                              saved_output_tokens?: number | null;
                              skipped_calls?: number | null;
                          }
                          | null;
                      policy_hash?: string
                      | null;
                      policy_id?: string | null;
                      policy_version?: string | null;
                      prompt_version?: string | null;
                      rule_set_hash?: string | null;
                      rule_set_id?: string | null;
                      rule_set_version?: string | null;
                      rule_sets?:
                          | { hash?: string
                          | null; id: string; version: string }[]
                          | null;
                      settings?: string | null;
                      started_at?: string | null;
                      status?: "failed" | "done" | "running" | "pending" | null;
                      warnings?: string[] | null;
                  }
                  | null;
              request: { [key: string]: unknown };
              started_by?: string | null;
              status: string;
          },
      >