@@ -43,7 +43,6 @@ export interface Variable {
4343 value : string ;
4444}
4545
46-
4746interface ToolChoice {
4847 type : 'function' ;
4948 function : { name : string } ;
@@ -174,9 +173,9 @@ export interface MemoryDeleteDocOptions {
174173
175174export interface MemoryUploadDocOptions {
176175 memoryName : string ;
177- fileName : string ;
176+ documentName : string ;
178177 meta ?: Record < string , string > ;
179- file : Buffer | File | FormData | ReadableStream ;
178+ document : Buffer | File | FormData | ReadableStream ;
180179 contentType :
181180 | 'application/pdf'
182181 | 'text/plain'
@@ -374,7 +373,9 @@ export class Langbase {
374373 * @param {string } options.description - The description of the memory.
375374 * @returns {Promise<MemoryCreateResponse> } A promise that resolves to the response of the memory creation.
376375 */
377- private async createMemory ( options : MemoryCreateOptions ) : Promise < MemoryCreateResponse > {
376+ private async createMemory (
377+ options : MemoryCreateOptions ,
378+ ) : Promise < MemoryCreateResponse > {
378379 return this . request . post ( {
379380 endpoint : '/v1/memory' ,
380381 body : options ,
@@ -399,7 +400,9 @@ export class Langbase {
399400 * @param {string } options.name - The name of the memory to delete.
400401 * @returns {Promise<MemoryDeleteResponse> } A promise that resolves to the response of the delete operation.
401402 */
402- private async deleteMemory ( options : MemoryDeleteOptions ) : Promise < MemoryDeleteResponse > {
403+ private async deleteMemory (
404+ options : MemoryDeleteOptions ,
405+ ) : Promise < MemoryDeleteResponse > {
403406 return this . request . delete ( {
404407 endpoint : `/v1/memory/${ options . name } ` ,
405408 } ) ;
@@ -466,13 +469,15 @@ export class Langbase {
466469 * @returns {Promise<Response> } The response from the upload request.
467470 * @throws Will throw an error if the upload fails.
468471 */
469- private async uploadDocs ( options : MemoryUploadDocOptions ) : Promise < Response > {
472+ private async uploadDocs (
473+ options : MemoryUploadDocOptions ,
474+ ) : Promise < Response > {
470475 try {
471476 const response = ( await this . request . post ( {
472477 endpoint : `/v1/memory/documents` ,
473478 body : {
474479 memoryName : options . memoryName ,
475- fileName : options . fileName ,
480+ fileName : options . documentName ,
476481 meta : options . meta ,
477482 } ,
478483 } ) ) as unknown as { signedUrl : string } ;
@@ -485,7 +490,7 @@ export class Langbase {
485490 Authorization : `Bearer ${ this . apiKey } ` ,
486491 'Content-Type' : options . contentType ,
487492 } ,
488- body : options . file ,
493+ body : options . document ,
489494 } ) ;
490495 } catch ( error ) {
491496 throw error ;
0 commit comments