mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-20 22:41:23 -04:00
fix: update user agent in AssemblyAI (#1039)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
"llamaindex-loader-example": patch
|
||||
---
|
||||
|
||||
fix: update user agent in AssemblyAI
|
||||
@@ -11,6 +11,7 @@
|
||||
"start:pdf": "node --import tsx ./src/pdf.ts",
|
||||
"start:llamaparse": "node --import tsx ./src/llamaparse.ts",
|
||||
"start:notion": "node --import tsx ./src/notion.ts",
|
||||
"start:assemblyai": "node --import tsx ./src/assemblyai.ts",
|
||||
"start:llamaparse-dir": "node --import tsx ./src/simple-directory-reader-with-llamaparse.ts",
|
||||
"start:llamaparse-json": "node --import tsx ./src/llamaparse-json.ts",
|
||||
"start:discord": "node --import tsx ./src/discord.ts"
|
||||
|
||||
@@ -11,7 +11,14 @@ import { AssemblyAI } from "assemblyai";
|
||||
import type { BaseReader } from "./type.js";
|
||||
|
||||
type AssemblyAIOptions = Partial<BaseServiceParams>;
|
||||
|
||||
const defaultOptions = {
|
||||
userAgent: {
|
||||
integration: {
|
||||
name: "LlamaIndexTS",
|
||||
version: "1.0.1",
|
||||
},
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Base class for AssemblyAI Readers.
|
||||
*/
|
||||
@@ -37,7 +44,10 @@ abstract class AssemblyAIReader implements BaseReader {
|
||||
);
|
||||
}
|
||||
|
||||
this.client = new AssemblyAI(options as BaseServiceParams);
|
||||
this.client = new AssemblyAI({
|
||||
...defaultOptions,
|
||||
...options,
|
||||
} as BaseServiceParams);
|
||||
}
|
||||
|
||||
abstract loadData(params: TranscribeParams | string): Promise<Document[]>;
|
||||
|
||||
Reference in New Issue
Block a user