UNPKG

@langchain/community

Version:
1 lines • 6.23 kB
{"version":3,"file":"assemblyai.d.cts","names":["AssemblyAI","TranscribeParams","SubtitleFormat","Transcript","TranscriptParagraph","TranscriptSentence","CreateTranscriptParameters","Document","BaseDocumentLoader","AssemblyAIOptions","AssemblyAILoader","CreateTranscriptLoader","Promise","AudioTranscriptLoader","AudioTranscriptParagraphsLoader","AudioTranscriptSentencesLoader","AudioSubtitleLoader"],"sources":["../../../src/document_loaders/web/assemblyai.d.ts"],"sourcesContent":["import { AssemblyAI, TranscribeParams, SubtitleFormat, Transcript, TranscriptParagraph, TranscriptSentence, CreateTranscriptParameters } from \"assemblyai\";\nimport { Document } from \"@langchain/core/documents\";\nimport { BaseDocumentLoader } from \"@langchain/core/document_loaders/base\";\nimport { AssemblyAIOptions } from \"../../types/assemblyai-types.js\";\nexport type * from \"../../types/assemblyai-types.js\";\n/**\n * Base class for AssemblyAI loaders.\n */\ndeclare abstract class AssemblyAILoader extends BaseDocumentLoader {\n protected client: AssemblyAI;\n /**\n * Create a new AssemblyAI loader.\n * @param assemblyAIOptions The options to configure the AssemblyAI loader.\n * Configure the `assemblyAIOptions.apiKey` with your AssemblyAI API key, or configure it as the `ASSEMBLYAI_API_KEY` environment variable.\n */\n constructor(assemblyAIOptions?: AssemblyAIOptions);\n}\ndeclare abstract class CreateTranscriptLoader extends AssemblyAILoader {\n protected transcribeParams?: TranscribeParams | CreateTranscriptParameters;\n protected transcriptId?: string;\n /**\n * Transcribe audio or retrieve an existing transcript by its ID.\n * @param params The parameters to transcribe audio, or the ID of the transcript to retrieve.\n * @param assemblyAIOptions The options to configure the AssemblyAI loader.\n * Configure the `assemblyAIOptions.apiKey` with your AssemblyAI API key, or configure it as the `ASSEMBLYAI_API_KEY` environment variable.\n */\n constructor(params: TranscribeParams | CreateTranscriptParameters | string, assemblyAIOptions?: AssemblyAIOptions);\n protected transcribeOrGetTranscript(): Promise<Transcript>;\n}\n/**\n * Transcribe audio and load the transcript as a document using AssemblyAI.\n */\nexport declare class AudioTranscriptLoader extends CreateTranscriptLoader {\n /**\n * Transcribe audio and load the transcript as a document using AssemblyAI.\n * @returns A promise that resolves to a single document containing the transcript text\n * as the page content, and the transcript object as the metadata.\n */\n load(): Promise<Document<Transcript>[]>;\n}\n/**\n * Transcribe audio and load the paragraphs of the transcript, creating a document for each paragraph.\n */\nexport declare class AudioTranscriptParagraphsLoader extends CreateTranscriptLoader {\n /**\n * Transcribe audio and load the paragraphs of the transcript, creating a document for each paragraph.\n * @returns A promise that resolves to an array of documents, each containing a paragraph of the transcript.\n */\n load(): Promise<Document<TranscriptParagraph>[]>;\n}\n/**\n * Transcribe audio and load the sentences of the transcript, creating a document for each sentence.\n */\nexport declare class AudioTranscriptSentencesLoader extends CreateTranscriptLoader {\n /**\n * Transcribe audio and load the sentences of the transcript, creating a document for each sentence.\n * @returns A promise that resolves to an array of documents, each containing a sentence of the transcript.\n */\n load(): Promise<Document<TranscriptSentence>[]>;\n}\n/**\n * Transcribe audio and load subtitles for the transcript as `srt` or `vtt` format.\n */\nexport declare class AudioSubtitleLoader extends CreateTranscriptLoader {\n private subtitleFormat;\n /**\n * Create a new AudioSubtitleLoader.\n * @param transcribeParams The parameters to transcribe audio.\n * @param subtitleFormat The format of the subtitles, either `srt` or `vtt`.\n * @param assemblyAIOptions The options to configure the AssemblyAI loader.\n * Configure the `assemblyAIOptions.apiKey` with your AssemblyAI API key, or configure it as the `ASSEMBLYAI_API_KEY` environment variable.\n */\n constructor(transcribeParams: TranscribeParams | CreateTranscriptParameters, subtitleFormat: SubtitleFormat, assemblyAIOptions?: AssemblyAIOptions);\n /**\n * Create a new AudioSubtitleLoader.\n * @param transcriptId The ID of the transcript to retrieve.\n * @param subtitleFormat The format of the subtitles, either `srt` or `vtt`.\n * @param assemblyAIOptions The options to configure the AssemblyAI loader.\n * Configure the `assemblyAIOptions.apiKey` with your AssemblyAI API key, or configure it as the `ASSEMBLYAI_API_KEY` environment variable.\n */\n constructor(transcriptId: string, subtitleFormat: SubtitleFormat, assemblyAIOptions?: AssemblyAIOptions);\n /**\n * Transcribe audio and load subtitles for the transcript as `srt` or `vtt` format.\n * @returns A promise that resolves a document containing the subtitles as the page content.\n */\n load(): Promise<Document[]>;\n}\n//# sourceMappingURL=assemblyai.d.ts.map"],"mappings":";;;;;;;;;;;uBAQuBU,gBAAAA,SAAyBF,kBAAAA;oBAC1BR;;;;;;kCAMcS;AAXiB;uBAa9BE,sBAAAA,SAA+BD,gBAAAA,CARhCV;EAMcS,UAAAA,gBAAAA,CAAAA,EAGHR,gBAHGQ,GAGgBH,0BAHhBG;EAPYD,UAAAA,YAAAA,CAAAA,EAAAA,MAAAA;EAAkB;AAAA;;;;;EAkBkCC,WAAAA,CAAAA,MAAAA,EAA5ER,gBAA4EQ,GAAzDH,0BAAyDG,GAAAA,MAAAA,EAAAA,iBAAAA,CAAAA,EAAAA,iBAAAA;EACjDN,UAAAA,yBAAAA,CAAAA,CAAAA,EAARS,OAAQT,CAAAA,UAAAA,CAAAA;;;AAVmB;AAetE;AAM6BA,cANRU,qBAAAA,SAA8BF,sBAAAA,CAMtBR;EAATI;;;AANqD;AAWzE;EAK6BH,IAAAA,CAAAA,CAAAA,EAVjBQ,OAUiBR,CAVTG,QAUSH,CAVAD,UAUAC,CAAAA,EAAAA,CAAAA;;;;AALsD;AAU9DW,cAVAD,+BAAAA,SAAwCH,sBAAAA,CAUV;EAKtBN;;;;EALqD,IAAA,CAAA,CAAA,EALtEO,OAKsE,CAL9DL,QAK8D,CALrDH,mBAKqD,CAAA,EAAA,CAAA;AAUlF;;;;AASqIK,cAnBhHM,8BAAAA,SAAuCJ,sBAAAA,CAmByEF;EAQ/EP;;;;EAjBLS,IAAAA,CAAAA,CAAAA,EALrCC,OAKqCD,CAL7BJ,QAK6BI,CALpBN,kBAKoBM,CAAAA,EAAAA,CAAAA;AAAsB;;;;cAAlDK,mBAAAA,SAA4BL,sBAAAA;;;;;;;;;gCASfV,mBAAmBK,4CAA4CJ,oCAAoCO;;;;;;;;oDAQ/EP,oCAAoCO;;;;;UAK9EG,QAAQL"}