Vana SDK - v4.1.0
    Preparing search index...

    Function waitForQuestion

    • Poll a question until it settles.

      Parameters

      • params: WaitForQuestionParams

      Returns Promise<
          {
              questionId: string;
              derivedScope: string;
              sourceScopes: string[];
              question: string;
              model: string
              | null;
              registeredBy:
                  | { kind: "owner" }
                  | { kind: "builder"; builder: string; grantId: string };
              status: "pending" | "failed" | "ready" | "stale";
              error: string | null;
              errorCode:
                  | "internal"
                  | "inference_unavailable"
                  | "source_missing"
                  | "grant_invalid"
                  | null;
              createdAt: string;
              updatedAt: string
              | null;
              lastComputedAt: string | null;
              derivedVersion: number | null;
              derivedCollectedAt: string | null;
          },
      >

      The settled registration (ready or failed).

      Calls getQuestion every pollIntervalMs until status is ready or failed and returns that state; a failed question is returned, not thrown, so the caller can read error and decide whether to recomputeQuestion. All polls share the one write session and each signs its own proof.

      const settled = await waitForQuestion({
      personalServerUrl,
      signer,
      grantId,
      questionId: registered.questionId,
      timeoutMs: 60_000,
      });
      if (settled.status === "ready") {
      // read derivedScope
      }

      The question had not settled within timeoutMs; it keeps computing on the server.

      Whatever getQuestion throws, and the signal's abort reason when the caller aborts.