Skip to content

Latest commit

 

History

History
158 lines (115 loc) · 14.9 KB

File metadata and controls

158 lines (115 loc) · 14.9 KB

Embedding

Overview

Available Operations

embeddingPresignCreateEmbeddingPresignToken

Creates a presign token for embedding operations with configurable expiration time

Example Usage

import { Documenso } from "@documenso/sdk-typescript";

const documenso = new Documenso({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const result = await documenso.embedding.embeddingPresignCreateEmbeddingPresignToken({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { embeddingEmbeddingPresignCreateEmbeddingPresignToken } from "@documenso/sdk-typescript/funcs/embeddingEmbeddingPresignCreateEmbeddingPresignToken.js";

// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const res = await embeddingEmbeddingPresignCreateEmbeddingPresignToken(documenso, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("embeddingEmbeddingPresignCreateEmbeddingPresignToken failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.EmbeddingPresignCreateEmbeddingPresignTokenRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.EmbeddingPresignCreateEmbeddingPresignTokenResponse>

Errors

Error Type Status Code Content Type
errors.EmbeddingPresignCreateEmbeddingPresignTokenBadRequestError 400 application/json
errors.EmbeddingPresignCreateEmbeddingPresignTokenUnauthorizedError 401 application/json
errors.EmbeddingPresignCreateEmbeddingPresignTokenForbiddenError 403 application/json
errors.EmbeddingPresignCreateEmbeddingPresignTokenInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*

embeddingPresignVerifyEmbeddingPresignToken

Verifies a presign token for embedding operations and returns the associated API token

Example Usage

import { Documenso } from "@documenso/sdk-typescript";

const documenso = new Documenso({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const result = await documenso.embedding.embeddingPresignVerifyEmbeddingPresignToken({
    token: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { embeddingEmbeddingPresignVerifyEmbeddingPresignToken } from "@documenso/sdk-typescript/funcs/embeddingEmbeddingPresignVerifyEmbeddingPresignToken.js";

// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const res = await embeddingEmbeddingPresignVerifyEmbeddingPresignToken(documenso, {
    token: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("embeddingEmbeddingPresignVerifyEmbeddingPresignToken failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.EmbeddingPresignVerifyEmbeddingPresignTokenRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.EmbeddingPresignVerifyEmbeddingPresignTokenResponse>

Errors

Error Type Status Code Content Type
errors.EmbeddingPresignVerifyEmbeddingPresignTokenBadRequestError 400 application/json
errors.EmbeddingPresignVerifyEmbeddingPresignTokenUnauthorizedError 401 application/json
errors.EmbeddingPresignVerifyEmbeddingPresignTokenForbiddenError 403 application/json
errors.EmbeddingPresignVerifyEmbeddingPresignTokenInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*