/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { entitiesCreateInstruction } from "../funcs/entitiesCreateInstruction.js"; import { entitiesDelete } from "../funcs/entitiesDelete.js"; import { entitiesListByDocument } from "../funcs/entitiesListByDocument.js"; import { entitiesListByInstruction } from "../funcs/entitiesListByInstruction.js"; import { entitiesListInstructions } from "../funcs/entitiesListInstructions.js"; import { entitiesUpdateInstruction } from "../funcs/entitiesUpdateInstruction.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class Entities extends ClientSDK { /** * List Instructions * * @remarks * List all instructions. */ async listInstructions( options?: RequestOptions, ): Promise> { return unwrapAsync(entitiesListInstructions( this, options, )); } /** * Create Instruction * * @remarks * Create a new instruction. Instructions are applied to documents as they are created or updated. The results of the instruction are stored as structured data in the schema defined by the `entity_schema` parameter. The `prompt` parameter is a natural language instruction which will be applied to documents. This feature is in beta and may change in the future. */ async createInstruction( request: components.CreateInstructionParams, options?: RequestOptions, ): Promise { return unwrapAsync(entitiesCreateInstruction( this, request, options, )); } /** * Update Instruction */ async updateInstruction( request: operations.UpdateInstructionRequest, options?: RequestOptions, ): Promise { return unwrapAsync(entitiesUpdateInstruction( this, request, options, )); } /** * Delete Instruction * * @remarks * Delete an instruction. This will delete the instruction and all entities generated by it. This operation is irreversible. */ async delete( request: operations.DeleteInstructionRequest, options?: RequestOptions, ): Promise<{ [k: string]: string }> { return unwrapAsync(entitiesDelete( this, request, options, )); } /** * Get Instruction Extracted Entities */ async listByInstruction( request: operations.ListEntitiesByInstructionRequest, options?: RequestOptions, ): Promise< PageIterator< operations.ListEntitiesByInstructionResponse, { cursor: string } > > { return unwrapResultIterator(entitiesListByInstruction( this, request, options, )); } /** * Get Document Extracted Entities */ async listByDocument( request: operations.ListEntitiesByDocumentRequest, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(entitiesListByDocument( this, request, options, )); } }