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

    Function registerQuestion

    • Register a standing question over the owner's source scopes.

      Parameters

      • params: RegisterQuestionParams

      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 registration, status: "pending".

      Sends POST /v1/derivatives/questions. The registration comes back pending and the first compute is scheduled immediately; poll it with waitForQuestion, then read derivedScope.

      const registered = await registerQuestion({
      personalServerUrl: "https://ps.example.com",
      signer,
      grantId,
      derivedScope: "coach.weekly",
      sourceScopes: ["oura.sleep", "chatgpt.conversations"],
      question: "How did my sleep relate to my mood this week?",
      });

      Before sending: a missing grant, a bad scope list, an over-long question, a derived scope under a source's namespace.

      403: a source scope is not read-granted to the builder (details.scopes).

      409: the question would make the derived scope a transitive source of itself.

      400 from the server.

      503: no compute layer.

      403: the grant does not authorize writing the derived scope.