PageSourceSearch

https://docs.toothfairyai.com/assets/js/b3972065.bbf4fcb1.js

js toothfairyai.com collected 2026-09-26 04:02:32 UTC 29,763 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunktf_docs=self.webpackChunktf_docs||[]).push([["4692"],{44593(e,t,l){l.r(t),l.d(t,{metadata:()=>n,default:()=>a,frontMatter:()=>r,contentTitle:()=>c,toc:()=>x,assets:()=>o});var n=JSON.parse('{"id":"node-sdk/documents","title":"Documents","description":"Node SDK manager for documents \u2014 fields documented from the API spec.","source":"@site/sdk/node-sdk/12-documents.md","sourceDirName":"node-sdk","slug":"/node-sdk/documents","permalink":"/sdk/node-sdk/documents","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1788069091000,"sidebarPosition":12,"frontMatter":{"id":"documents","title":"Documents","sidebar_label":"Documents","sidebar_position":12,"description":"Node SDK manager for documents \u2014 fields documented from the API spec."},"sidebar":"tutorialSidebar","previous":{"title":"Dictionary","permalink":"/sdk/node-sdk/dictionary"},"next":{"title":"Embeddings","permalink":"/sdk/node-sdk/embeddings"}}'),s=l(74848),d=l(28453),i=l(73385);let r={id:"documents",title:"Documents",sidebar_label:"Documents",sidebar_position:12,description:"Node SDK manager for documents \u2014 fields documented from the API spec."},c,o={},x=[{value:"Documents",id:"documents",level:2},{value:"Methods",id:"methods",level:3},{value:"create",id:"create",level:3},{value:"Request fields",id:"request-fields",level:4},{value:"Response fields",id:"response-fields",level:4},{value:"Example",id:"example",level:4},{value:"createFromPath",id:"createFromPath",level:3},{value:"Example",id:"example-1",level:4},{value:"update",id:"update",level:3},{value:"Request fields",id:"request-fields-1",level:4},{value:"Response",id:"response",level:4},{value:"Example",id:"example-2",level:4},{value:"get",id:"get",level:3},{value:"Response",id:"response-1",level:4},{value:"Example",id:"example-3",level:4},{value:"delete",id:"delete",level:3},{value:"Response fields",id:"response-fields-1",level:4},{value:"Example",id:"example-4",level:4},{value:"list",id:"list",level:3},{value:"Example",id:"example-5",level:4},{value:"search",id:"search",level:3},{value:"Request fields",id:"request-fields-2",level:4},{value:"Response fields",id:"response-fields-2",level:4},{value:"Example",id:"example-6",level:4},{value:"upload",id:"upload",level:3},{value:"Example",id:"example-7",level:4},{value:"uploadFromBase64",id:"uploadFromBase64",level:3},{value:"Example",id:"example-8",level:4},{value:"download",id:"download",level:3},{value:"Example",id:"example-9",level:4}];function h(e){let t={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"documents",children:"Documents"}),"\n",(0,s.jsx)(i.A,{pkg:"@toothfairyai/sdk",registry:"npm"}),"\n",(0,s.jsx)(t.p,{children:"Document Management Module Handles document CRUD operations, file upload/download, and semantic search."}),"\n",(0,s.jsxs)(t.p,{children:["Accessed via ",(0,s.jsx)(t.code,{children:"client.documents"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"methods",children:"Methods"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Method"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"HTTP"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Endpoint"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#create",children:(0,s.jsx)(t.code,{children:"create"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"POST"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"POST /doc/create"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#createFromPath",children:(0,s.jsx)(t.code,{children:"createFromPath"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"\u2014"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.em,{children:"derived"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#update",children:(0,s.jsx)(t.code,{children:"update"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"POST"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"POST /doc/update"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#get",children:(0,s.jsx)(t.code,{children:"get"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"GET"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"GET /doc/get/{id}"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#delete",children:(0,s.jsx)(t.code,{children:"delete"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"DELETE"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"DELETE /doc/delete/{id}"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#list",children:(0,s.jsx)(t.code,{children:"list"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"GET"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"GET /doc/list"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#search",children:(0,s.jsx)(t.code,{children:"search"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"POST"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"POST /searcher"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#upload",children:(0,s.jsx)(t.code,{children:"upload"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"\u2014"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.em,{children:"derived"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#uploadFromBase64",children:(0,s.jsx)(t.code,{children:"uploadFromBase64"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"\u2014"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.em,{children:"derived"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"#download",children:(0,s.jsx)(t.code,{children:"download"})})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"\u2014"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.em,{children:"derived"})})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"create",children:"create"}),"\n",(0,s.jsx)(t.p,{children:"Create a new document"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async create(documentData: DocumentCreateData)\n"})}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Endpoint:"})," ",(0,s.jsx)(t.code,{children:"POST /doc/create"})," \xb7 API service"]}),"\n",(0,s.jsx)(t.h4,{id:"request-fields",children:"Request fields"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Field"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Type"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Required"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"workspaceid"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"yes"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Unique workspace identifier in UUID v4 format"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"userid"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"yes"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"User ID creating the document"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"data"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"array<object>"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"yes"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Array of document records to ingest. Each element is a field mapping for one document row; the shape depends on the document type."})]})]})]}),"\n",(0,s.jsx)(t.h4,{id:"response-fields",children:"Response fields"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Field"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Type"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"id"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"integer"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Unique identifier for the document"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"document"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"array<object>"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Document data structure for NLP documents"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"workspaceid"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Unique workspace identifier in UUID v4 format"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"trainingdata"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"object"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Training data for machine learning models"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"insertionat"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Document creation timestamp"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"updatedat"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Document last update timestamp"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"createdby"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"User ID who created the document"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"updatedby"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"User ID who last updated the document"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"topics"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"array<string>"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Associated topic IDs"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"type"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Document type classification"})]})]})]}),"\n",(0,s.jsxs)(t.p,{children:["Allowed: ",(0,s.jsx)(t.code,{children:"nlpTraining"}
1),", ",(0,s.jsx)(t.code,{children:"readComprehensionTraining"}),", ",(0,s.jsx)(t.code,{children:"readComprehensionContent"}),", ",(0,s.jsx)(t.code,{children:"questionAnswering"}),", ",(0,s.jsx)(t.code,{children:"generativeTraining"}),", ",(0,s.jsx)(t.code,{children:"readComprehensionPdf"}),", ",(0,s.jsx)(t.code,{children:"readComprehensionFile"}),", ",(0,s.jsx)(t.code,{children:"readComprehensionUrl"})," |\n| ",(0,s.jsx)(t.code,{children:"rawtext"})," | ",(0,s.jsx)(t.code,{children:"string"})," | Raw text content of the document |\n| ",(0,s.jsx)(t.code,{children:"istrained"})," | ",(0,s.jsx)(t.code,{children:"boolean"})," | Whether the document has been trained |\n| ",(0,s.jsx)(t.code,{children:"source"})," | ",(0,s.jsx)(t.code,{children:"string"})," | Document source or origin |\n| ",(0,s.jsx)(t.code,{children:"title"})," | ",(0,s.jsx)(t.code,{children:"string"})," | Document title |\n| ",(0,s.jsx)(t.code,{children:"folderid"})," | ",(0,s.jsx)(t.code,{children:"string"})," | Parent folder identifier |\n| ",(0,s.jsx)(t.code,{children:"scope"})," | ",(0,s.jsx)(t.code,{children:"string"})," | Document scope for training purposes"]}),"\n",(0,s.jsxs)(t.p,{children:["Allowed: ",(0,s.jsx)(t.code,{children:"training"}),", ",(0,s.jsx)(t.code,{children:"validation"})," |\n| ",(0,s.jsx)(t.code,{children:"status"})," | ",(0,s.jsx)(t.code,{children:"string"})," | Document publication status"]}),"\n",(0,s.jsxs)(t.p,{children:["Allowed: ",(0,s.jsx)(t.code,{children:"draft"}),", ",(0,s.jsx)(t.code,{children:"published"}),", ",(0,s.jsx)(t.code,{children:"archived"}),", ",(0,s.jsx)(t.code,{children:"suspended"})," |\n| ",(0,s.jsx)(t.code,{children:"external_path"})," | ",(0,s.jsx)(t.code,{children:"string"})," | External file path or URL |\n| ",(0,s.jsx)(t.code,{children:"siteid"})," | ",(0,s.jsx)(t.code,{children:"string"})," | Associated site identifier |\n| ",(0,s.jsx)(t.code,{children:"hash"})," | ",(0,s.jsx)(t.code,{children:"string"})," | Document hash for validation |\n| ",(0,s.jsx)(t.code,{children:"tokens"})," | ",(0,s.jsx)(t.code,{children:"integer"})," | Number of tokens in the document |\n| ",(0,s.jsx)(t.code,{children:"completion_percentage"})," | ",(0,s.jsx)(t.code,{children:"integer"})," | Processing completion percentage |"]}),"\n",(0,s.jsx)(t.h4,{id:"example",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.create(\u2026);\n"})}),"\n",(0,s.jsx)(t.h3,{id:"createFromPath",children:"createFromPath"}),"\n",(0,s.jsx)(t.p,{children:"Create a document from a file path or URL"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async createFromPath(\n    filePath: string,\n    userId: string,\n    options: {\n      title?: string;\n      folderId?: string;\n      topics?: string[];\n      status?: string;\n      scope?: string;\n    } = {}\n)\n"})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.em,{children:"Derived method \u2014 delegates to another SDK call and performs no direct HTTP request."})}),"\n",(0,s.jsx)(t.h4,{id:"example-1",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.createFromPath('\u2026', 'agent-id');\n"})}),"\n",(0,s.jsx)(t.h3,{id:"update",children:"update"}),"\n",(0,s.jsx)(t.p,{children:"Update an existing document"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async update(documentId: string, userId: string, fields: DocumentUpdateData)\n"})}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Endpoint:"})," ",(0,s.jsx)(t.code,{children:"POST /doc/update"})," \xb7 API service"]}),"\n",(0,s.jsx)(t.h4,{id:"request-fields-1",children:"Request fields"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Field"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Type"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Required"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"fields"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"object"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"yes"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Document fields to update, as a key\u2013value mapping of field name to new value."})]})})]}),"\n",(0,s.jsx)(t.h4,{id:"response",children:"Response"}),"\n",(0,s.jsxs)(t.p,{children:["Returns the ",(0,s.jsx)(t.a,{href:"#create",children:(0,s.jsx)(t.code,{children:"Document"})})," object \u2014 fields documented in the ",(0,s.jsx)(t.a,{href:"#create",children:(0,s.jsx)(t.code,{children:"create"})})," section above."]}),"\n",(0,s.jsx)(t.h4,{id:"example-2",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.update('agent-id', 'agent-id', \u2026);\n"})}),"\n",(0,s.jsx)(t.h3,{id:"get",children:"get"}),"\n",(0,s.jsx)(t.p,{children:"Get a document by ID"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async get(documentId: string)\n"})}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Endpoint:"})," ",(0,s.jsx)(t.code,{children:"GET /doc/get/{id}"})," \xb7 API service"]}),"\n",(0,s.jsx)(t.h4,{id:"response-1",children:"Response"}),"\n",(0,s.jsxs)(t.p,{children:["Returns the ",(0,s.jsx)(t.a,{href:"#create",children:(0,s.jsx)(t.code,{children:"Document"})})," object \u2014 fields documented in the ",(0,s.jsx)(t.a,{href:"#create",children:(0,s.jsx)(t.code,{children:"create"})})," section above."]}),"\n",(0,s.jsx)(t.h4,{id:"example-3",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.get('agent-id');\n"})}),"\n",(0,s.jsx)(t.h3,{id:"delete",children:"delete"}),"\n",(0,s.jsx)(t.p,{children:"Delete a document"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async delete(documentId: string): Promise<\n"})}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Endpoint:"})," ",(0,s.jsx)(t.code,{children:"DELETE /doc/delete/{id}"})," \xb7 API service"]}),"\n",(0,s.jsx)(t.h4,{id:"response-fields-1",children:"Response fields"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Field"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Type"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"success"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"boolean"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Operation success status"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"data"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"object"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Response data"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"message"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Optional success message"})]})]})]}),"\n",(0,s.jsx)(t.h4,{id:"example-4",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.delete('agent-id');\n"})}),"\n",(0,s.jsx)(t.h3,{id:"list",children:"list"}),"\n",(0,s.jsx)(t.p,{children:"List documents in the workspace"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async list(\n    options: {\n    limit?: number;\n    pageLimit?: number;\n    page?: number;\n    folderId?: string;\n    status?: string;\n  } = {}\n)\n"})}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Endpoint:"})," ",(0,s.jsx)(t.code,{children:"GET /doc/list"})," \xb7 API service"]}),"\n",(0,s.jsx)(t.h4,{id:"example-5",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.list();\n"})}),"\n",(0,s.jsx)(t.h3,{id:"search",children:"search"}),"\n",(0,s.jsx)(t.p,{children:"Search documents using semantic search"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async search(\n    text: string,\n    options: {\n      topK?: number;\n      metadata?: Record<string, any>;\n    } = {}\n)\n"})}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Endpoint:"})," ",(0,s.jsx)(t.code,{children:"POST /searcher"})," \xb7 AI service"]}),"\n",(0,s.jsx)(t.h4,{id:"request-fields-2",children:"Request fields"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Field"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Type"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Required"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"workspaceid"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"yes"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Unique workspace identifier"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"text"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"no"}),(0,s.jsxs)(t.td,{style:{textAlign:"left"},children:["Search query for knowledge hub documents. Optional if a precomputed ",(0,s.jsx)(t.code,{children:"embedding"})," vector is supplied; when both are present the text is ignored for vector generation."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"embedding"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"array<number>"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"no"}),(0,s.jsxs)(t.td,{style:{textAlign:"left"}
1,children:["Precomputed embedding vector (flat numeric array). Conditionally required when ",(0,s.jsx)(t.code,{children:"text"})," is absent; the handler searches using this vector directly. When ",(0,s.jsx)(t.code,{children:"text"})," is present, ",(0,s.jsx)(t.code,{children:"embedding"})," is optional and ignored for vector generation."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"topK"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"integer"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"no"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Number of documents to retrieve (backend default 5)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"metadata"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"object"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"no"}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Optional metadata filters for advanced document search. Supports filtering by document status, specific document IDs, and topic arrays."})]})]})]}),"\n",(0,s.jsx)(t.h4,{id:"response-fields-2",children:"Response fields"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsxs)(t.em,{children:["Returns an array of ",(0,s.jsx)(t.code,{children:"SearchResponse"}),"; fields of each element:"]})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Field"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Type"}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"id"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Document unique identifier"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"score"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"number"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Document relevance score (0.0 to 1.0)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"metadata"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.code,{children:"object"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:"Document metadata and content"})]})]})]}),"\n",(0,s.jsx)(t.h4,{id:"example-6",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.search('\u2026');\n"})}),"\n",(0,s.jsx)(t.h3,{id:"upload",children:"upload"}),"\n",(0,s.jsx)(t.p,{children:"Upload a file to ToothFairy"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async upload(filePath: string, options: FileUploadOptions = {})\n"})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.em,{children:"Derived method \u2014 delegates to another SDK call and performs no direct HTTP request."})}),"\n",(0,s.jsx)(t.h4,{id:"example-7",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.upload('\u2026');\n"})}),"\n",(0,s.jsx)(t.h3,{id:"uploadFromBase64",children:"uploadFromBase64"}),"\n",(0,s.jsx)(t.p,{children:"Upload a file from base64 string to ToothFairy"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async uploadFromBase64(base64Data: string, options: Base64FileUploadOptions)\n"})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.em,{children:"Derived method \u2014 delegates to another SDK call and performs no direct HTTP request."})}),"\n",(0,s.jsx)(t.h4,{id:"example-8",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.uploadFromBase64('\u2026', \u2026);\n"})}),"\n",(0,s.jsx)(t.h3,{id:"download",children:"download"}),"\n",(0,s.jsx)(t.p,{children:"Download a file from ToothFairy"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"async download(\n    filename: string,\n    outputPath: string,\n    options: FileDownloadOptions = {}\n)\n"})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.em,{children:"Derived method \u2014 delegates to another SDK call and performs no direct HTTP request."})}),"\n",(0,s.jsx)(t.h4,{id:"example-9",children:"Example"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"const result = await client.documents.download('\u2026', '\u2026');\n"})})]})}function a(e={}){let{wrapper:t}={...(0,d.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},73385(e,t,l){l.d(t,{A:()=>d});var n=l(96540),s=l(74848);function d({pkg:e,registry:t="npm"}
1){let[l,i]=(0,n.useState)(null),[r,c]=(0,n.useState)("loading");return((0,n.useEffect)(()=>{"u">typeof window&&e&&l();async function l(){try{let l="pypi"===t?`https://pypi.org/pypi/${encodeURIComponent(e)}/json`:`https://registry.npmjs.org/${encodeURIComponent(e).replace("%40","@")}/latest`,n=await fetch(l,{cache:"no-store"});if(!n.ok)throw Error("registry request failed");let s=await n.json(),d="pypi"===t?s.info.version:s.version;if(!d)throw Error("no version in response");i(d),c("live")}catch(e){console.error("PackageVersion fetch failed:",e),c("error")}}},[e,t]),"loading"===r)?(0,s.jsxs)("span",{style:{fontFamily:"var(--ifm-font-family-monospace)",fontSize:"0.8em",padding:"2px 8px",borderRadius:"4px",backgroundColor:"var(--ifm-color-primary-lightest)",border:"1px solid var(--ifm-color-primary-light)",color:"var(--ifm-color-primary-dark)"},children:[e,"@latest\u2026"]}):(0,s.jsxs)("span",{title:"live"===r?`Live from ${t}`:"Registry unreachable \u2014 fallback",style:{fontFamily:"var(--ifm-font-family-monospace)",fontSize:"0.8em",padding:"2px 8px",borderRadius:"4px",backgroundColor:"live"===r?"var(--ifm-color-success)":"var(--ifm-color-danger)",border:`1px solid ${"live"===r?"var(--ifm-color-success-dark)":"var(--ifm-color-danger-dark)"}`,color:"#ffffff"},children:[e,"@","live"===r?l:"latest"]})}},28453(e,t,l){l.d(t,{R:()=>i,x:()=>r});var n=l(96540);let s={},d=n.createContext(s);function i(e){let t=n.useContext(d);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),n.createElement(d.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.