notebooklm-sdk 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +105 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -1
- package/dist/index.d.ts +41 -1
- package/dist/index.js +106 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -148,6 +148,13 @@ declare const ExportType: {
|
|
|
148
148
|
readonly SHEETS: 2;
|
|
149
149
|
};
|
|
150
150
|
type ExportTypeValue = (typeof ExportType)[keyof typeof ExportType];
|
|
151
|
+
declare const DriveMimeType: {
|
|
152
|
+
readonly GOOGLE_DOC: "application/vnd.google-apps.document";
|
|
153
|
+
readonly GOOGLE_SLIDES: "application/vnd.google-apps.presentation";
|
|
154
|
+
readonly GOOGLE_SHEETS: "application/vnd.google-apps.spreadsheet";
|
|
155
|
+
readonly PDF: "application/pdf";
|
|
156
|
+
};
|
|
157
|
+
type DriveMimeTypeValue = (typeof DriveMimeType)[keyof typeof DriveMimeType];
|
|
151
158
|
/**
|
|
152
159
|
* Predefined chat modes that control response style and verbosity.
|
|
153
160
|
* Applied per-notebook via `client.chat.setMode()`.
|
|
@@ -163,6 +170,24 @@ declare const ChatMode: {
|
|
|
163
170
|
readonly DETAILED: "detailed";
|
|
164
171
|
};
|
|
165
172
|
type ChatModeValue = (typeof ChatMode)[keyof typeof ChatMode];
|
|
173
|
+
declare const ChatGoal: {
|
|
174
|
+
/** General purpose research and brainstorming. */
|
|
175
|
+
readonly DEFAULT: 1;
|
|
176
|
+
/** Custom instructions (up to 10,000 characters). */
|
|
177
|
+
readonly CUSTOM: 2;
|
|
178
|
+
/** Educational focus with learning-oriented responses. */
|
|
179
|
+
readonly LEARNING_GUIDE: 3;
|
|
180
|
+
};
|
|
181
|
+
type ChatGoalValue = (typeof ChatGoal)[keyof typeof ChatGoal];
|
|
182
|
+
declare const ChatResponseLength: {
|
|
183
|
+
/** Standard response length. */
|
|
184
|
+
readonly DEFAULT: 1;
|
|
185
|
+
/** Verbose, detailed responses. */
|
|
186
|
+
readonly LONGER: 4;
|
|
187
|
+
/** Concise, brief responses. */
|
|
188
|
+
readonly SHORTER: 5;
|
|
189
|
+
};
|
|
190
|
+
type ChatResponseLengthValue = (typeof ChatResponseLength)[keyof typeof ChatResponseLength];
|
|
166
191
|
declare const ShareAccess: {
|
|
167
192
|
/** Only explicitly shared users can access */
|
|
168
193
|
readonly RESTRICTED: 0;
|
|
@@ -390,6 +415,14 @@ declare class ArtifactsAPI {
|
|
|
390
415
|
list(notebookId: string): Promise<Artifact[]>;
|
|
391
416
|
private _listRaw;
|
|
392
417
|
get(notebookId: string, artifactId: string): Promise<Artifact | null>;
|
|
418
|
+
listAudio(notebookId: string): Promise<Artifact[]>;
|
|
419
|
+
listVideo(notebookId: string): Promise<Artifact[]>;
|
|
420
|
+
listReports(notebookId: string): Promise<Artifact[]>;
|
|
421
|
+
listQuizzes(notebookId: string): Promise<Artifact[]>;
|
|
422
|
+
listFlashcards(notebookId: string): Promise<Artifact[]>;
|
|
423
|
+
listInfographics(notebookId: string): Promise<Artifact[]>;
|
|
424
|
+
listSlideDecks(notebookId: string): Promise<Artifact[]>;
|
|
425
|
+
listDataTables(notebookId: string): Promise<Artifact[]>;
|
|
393
426
|
delete(notebookId: string, artifactId: string): Promise<boolean>;
|
|
394
427
|
rename(notebookId: string, artifactId: string, newTitle: string): Promise<boolean>;
|
|
395
428
|
createAudio(notebookId: string, opts?: CreateAudioOptions): Promise<GenerationStatus>;
|
|
@@ -444,6 +477,12 @@ declare class ChatAPI {
|
|
|
444
477
|
ask(notebookId: string, query: string, opts?: AskOptions): Promise<AskResult>;
|
|
445
478
|
getConversationTurns(notebookId: string, conversationId: string): Promise<ConversationTurn[]>;
|
|
446
479
|
getLastConversationId(notebookId: string): Promise<string | null>;
|
|
480
|
+
/**
|
|
481
|
+
* Low-level chat configuration. Set goal, response length, and optional
|
|
482
|
+
* custom instructions directly. Persists on the server per notebook.
|
|
483
|
+
* Use `setMode()` for preset combinations instead.
|
|
484
|
+
*/
|
|
485
|
+
configure(notebookId: string, goal: ChatGoalValue, length: ChatResponseLengthValue, customPrompt?: string): Promise<void>;
|
|
447
486
|
/**
|
|
448
487
|
* Set the chat mode for a notebook. Persists on the server — affects all
|
|
449
488
|
* subsequent `ask()` calls until changed.
|
|
@@ -564,6 +603,7 @@ declare class SourcesAPI {
|
|
|
564
603
|
get(notebookId: string, sourceId: string): Promise<Source | null>;
|
|
565
604
|
addUrl(notebookId: string, url: string, opts?: AddSourceOptions): Promise<Source>;
|
|
566
605
|
addText(notebookId: string, text: string, title?: string, opts?: AddSourceOptions): Promise<Source>;
|
|
606
|
+
addDrive(notebookId: string, fileId: string, title: string, mimeType?: DriveMimeTypeValue, opts?: AddSourceOptions): Promise<Source>;
|
|
567
607
|
addFile(notebookId: string, filePath: string, mimeType: string, opts?: AddSourceOptions): Promise<Source>;
|
|
568
608
|
addFileBuffer(notebookId: string, data: Buffer | Uint8Array, fileName: string, _mimeType: string, opts?: AddSourceOptions): Promise<Source>;
|
|
569
609
|
private startResumableUpload;
|
|
@@ -618,4 +658,4 @@ declare class NotebookLMClient {
|
|
|
618
658
|
refreshTokens(): Promise<void>;
|
|
619
659
|
}
|
|
620
660
|
|
|
621
|
-
export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, ChatMode, type ChatModeValue, type ChatReference, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, type ReportSuggestion, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceFulltext, type SourceGuide, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
|
|
661
|
+
export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, ChatGoal, type ChatGoalValue, ChatMode, type ChatModeValue, type ChatReference, ChatResponseLength, type ChatResponseLengthValue, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, DriveMimeType, type DriveMimeTypeValue, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, type ReportSuggestion, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceFulltext, type SourceGuide, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -148,6 +148,13 @@ declare const ExportType: {
|
|
|
148
148
|
readonly SHEETS: 2;
|
|
149
149
|
};
|
|
150
150
|
type ExportTypeValue = (typeof ExportType)[keyof typeof ExportType];
|
|
151
|
+
declare const DriveMimeType: {
|
|
152
|
+
readonly GOOGLE_DOC: "application/vnd.google-apps.document";
|
|
153
|
+
readonly GOOGLE_SLIDES: "application/vnd.google-apps.presentation";
|
|
154
|
+
readonly GOOGLE_SHEETS: "application/vnd.google-apps.spreadsheet";
|
|
155
|
+
readonly PDF: "application/pdf";
|
|
156
|
+
};
|
|
157
|
+
type DriveMimeTypeValue = (typeof DriveMimeType)[keyof typeof DriveMimeType];
|
|
151
158
|
/**
|
|
152
159
|
* Predefined chat modes that control response style and verbosity.
|
|
153
160
|
* Applied per-notebook via `client.chat.setMode()`.
|
|
@@ -163,6 +170,24 @@ declare const ChatMode: {
|
|
|
163
170
|
readonly DETAILED: "detailed";
|
|
164
171
|
};
|
|
165
172
|
type ChatModeValue = (typeof ChatMode)[keyof typeof ChatMode];
|
|
173
|
+
declare const ChatGoal: {
|
|
174
|
+
/** General purpose research and brainstorming. */
|
|
175
|
+
readonly DEFAULT: 1;
|
|
176
|
+
/** Custom instructions (up to 10,000 characters). */
|
|
177
|
+
readonly CUSTOM: 2;
|
|
178
|
+
/** Educational focus with learning-oriented responses. */
|
|
179
|
+
readonly LEARNING_GUIDE: 3;
|
|
180
|
+
};
|
|
181
|
+
type ChatGoalValue = (typeof ChatGoal)[keyof typeof ChatGoal];
|
|
182
|
+
declare const ChatResponseLength: {
|
|
183
|
+
/** Standard response length. */
|
|
184
|
+
readonly DEFAULT: 1;
|
|
185
|
+
/** Verbose, detailed responses. */
|
|
186
|
+
readonly LONGER: 4;
|
|
187
|
+
/** Concise, brief responses. */
|
|
188
|
+
readonly SHORTER: 5;
|
|
189
|
+
};
|
|
190
|
+
type ChatResponseLengthValue = (typeof ChatResponseLength)[keyof typeof ChatResponseLength];
|
|
166
191
|
declare const ShareAccess: {
|
|
167
192
|
/** Only explicitly shared users can access */
|
|
168
193
|
readonly RESTRICTED: 0;
|
|
@@ -390,6 +415,14 @@ declare class ArtifactsAPI {
|
|
|
390
415
|
list(notebookId: string): Promise<Artifact[]>;
|
|
391
416
|
private _listRaw;
|
|
392
417
|
get(notebookId: string, artifactId: string): Promise<Artifact | null>;
|
|
418
|
+
listAudio(notebookId: string): Promise<Artifact[]>;
|
|
419
|
+
listVideo(notebookId: string): Promise<Artifact[]>;
|
|
420
|
+
listReports(notebookId: string): Promise<Artifact[]>;
|
|
421
|
+
listQuizzes(notebookId: string): Promise<Artifact[]>;
|
|
422
|
+
listFlashcards(notebookId: string): Promise<Artifact[]>;
|
|
423
|
+
listInfographics(notebookId: string): Promise<Artifact[]>;
|
|
424
|
+
listSlideDecks(notebookId: string): Promise<Artifact[]>;
|
|
425
|
+
listDataTables(notebookId: string): Promise<Artifact[]>;
|
|
393
426
|
delete(notebookId: string, artifactId: string): Promise<boolean>;
|
|
394
427
|
rename(notebookId: string, artifactId: string, newTitle: string): Promise<boolean>;
|
|
395
428
|
createAudio(notebookId: string, opts?: CreateAudioOptions): Promise<GenerationStatus>;
|
|
@@ -444,6 +477,12 @@ declare class ChatAPI {
|
|
|
444
477
|
ask(notebookId: string, query: string, opts?: AskOptions): Promise<AskResult>;
|
|
445
478
|
getConversationTurns(notebookId: string, conversationId: string): Promise<ConversationTurn[]>;
|
|
446
479
|
getLastConversationId(notebookId: string): Promise<string | null>;
|
|
480
|
+
/**
|
|
481
|
+
* Low-level chat configuration. Set goal, response length, and optional
|
|
482
|
+
* custom instructions directly. Persists on the server per notebook.
|
|
483
|
+
* Use `setMode()` for preset combinations instead.
|
|
484
|
+
*/
|
|
485
|
+
configure(notebookId: string, goal: ChatGoalValue, length: ChatResponseLengthValue, customPrompt?: string): Promise<void>;
|
|
447
486
|
/**
|
|
448
487
|
* Set the chat mode for a notebook. Persists on the server — affects all
|
|
449
488
|
* subsequent `ask()` calls until changed.
|
|
@@ -564,6 +603,7 @@ declare class SourcesAPI {
|
|
|
564
603
|
get(notebookId: string, sourceId: string): Promise<Source | null>;
|
|
565
604
|
addUrl(notebookId: string, url: string, opts?: AddSourceOptions): Promise<Source>;
|
|
566
605
|
addText(notebookId: string, text: string, title?: string, opts?: AddSourceOptions): Promise<Source>;
|
|
606
|
+
addDrive(notebookId: string, fileId: string, title: string, mimeType?: DriveMimeTypeValue, opts?: AddSourceOptions): Promise<Source>;
|
|
567
607
|
addFile(notebookId: string, filePath: string, mimeType: string, opts?: AddSourceOptions): Promise<Source>;
|
|
568
608
|
addFileBuffer(notebookId: string, data: Buffer | Uint8Array, fileName: string, _mimeType: string, opts?: AddSourceOptions): Promise<Source>;
|
|
569
609
|
private startResumableUpload;
|
|
@@ -618,4 +658,4 @@ declare class NotebookLMClient {
|
|
|
618
658
|
refreshTokens(): Promise<void>;
|
|
619
659
|
}
|
|
620
660
|
|
|
621
|
-
export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, ChatMode, type ChatModeValue, type ChatReference, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, type ReportSuggestion, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceFulltext, type SourceGuide, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
|
|
661
|
+
export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, ChatGoal, type ChatGoalValue, ChatMode, type ChatModeValue, type ChatReference, ChatResponseLength, type ChatResponseLengthValue, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, DriveMimeType, type DriveMimeTypeValue, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, type ReportSuggestion, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceFulltext, type SourceGuide, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,10 @@ __export(enums_exports, {
|
|
|
19
19
|
ArtifactTypeCode: () => ArtifactTypeCode,
|
|
20
20
|
AudioFormat: () => AudioFormat,
|
|
21
21
|
AudioLength: () => AudioLength,
|
|
22
|
+
ChatGoal: () => ChatGoal,
|
|
22
23
|
ChatMode: () => ChatMode,
|
|
24
|
+
ChatResponseLength: () => ChatResponseLength,
|
|
25
|
+
DriveMimeType: () => DriveMimeType,
|
|
23
26
|
ExportType: () => ExportType,
|
|
24
27
|
InfographicDetail: () => InfographicDetail,
|
|
25
28
|
InfographicOrientation: () => InfographicOrientation,
|
|
@@ -62,7 +65,7 @@ function sourceStatusFromCode(code) {
|
|
|
62
65
|
function chatModeToParams(mode) {
|
|
63
66
|
return CHAT_MODE_PARAMS[mode];
|
|
64
67
|
}
|
|
65
|
-
var RPCMethod, ArtifactTypeCode, ArtifactStatusCode, SourceStatusCode, AudioFormat, AudioLength, VideoFormat, VideoStyle, QuizQuantity, QuizDifficulty, InfographicOrientation, InfographicDetail, InfographicStyle, SlideDeckFormat, SlideDeckLength, ExportType, SOURCE_TYPE_MAP, ARTIFACT_TYPE_MAP, ARTIFACT_STATUS_MAP, SOURCE_STATUS_MAP, ChatMode, CHAT_MODE_PARAMS, ShareAccess, ShareViewLevel, SharePermission;
|
|
68
|
+
var RPCMethod, ArtifactTypeCode, ArtifactStatusCode, SourceStatusCode, AudioFormat, AudioLength, VideoFormat, VideoStyle, QuizQuantity, QuizDifficulty, InfographicOrientation, InfographicDetail, InfographicStyle, SlideDeckFormat, SlideDeckLength, ExportType, DriveMimeType, SOURCE_TYPE_MAP, ARTIFACT_TYPE_MAP, ARTIFACT_STATUS_MAP, SOURCE_STATUS_MAP, ChatMode, CHAT_MODE_PARAMS, ChatGoal, ChatResponseLength, ShareAccess, ShareViewLevel, SharePermission;
|
|
66
69
|
var init_enums = __esm({
|
|
67
70
|
"src/types/enums.ts"() {
|
|
68
71
|
RPCMethod = {
|
|
@@ -211,6 +214,12 @@ var init_enums = __esm({
|
|
|
211
214
|
DOCS: 1,
|
|
212
215
|
SHEETS: 2
|
|
213
216
|
};
|
|
217
|
+
DriveMimeType = {
|
|
218
|
+
GOOGLE_DOC: "application/vnd.google-apps.document",
|
|
219
|
+
GOOGLE_SLIDES: "application/vnd.google-apps.presentation",
|
|
220
|
+
GOOGLE_SHEETS: "application/vnd.google-apps.spreadsheet",
|
|
221
|
+
PDF: "application/pdf"
|
|
222
|
+
};
|
|
214
223
|
SOURCE_TYPE_MAP = {
|
|
215
224
|
1: "google_docs",
|
|
216
225
|
2: "google_slides",
|
|
@@ -262,6 +271,22 @@ var init_enums = __esm({
|
|
|
262
271
|
concise: [1, 5],
|
|
263
272
|
detailed: [1, 4]
|
|
264
273
|
};
|
|
274
|
+
ChatGoal = {
|
|
275
|
+
/** General purpose research and brainstorming. */
|
|
276
|
+
DEFAULT: 1,
|
|
277
|
+
/** Custom instructions (up to 10,000 characters). */
|
|
278
|
+
CUSTOM: 2,
|
|
279
|
+
/** Educational focus with learning-oriented responses. */
|
|
280
|
+
LEARNING_GUIDE: 3
|
|
281
|
+
};
|
|
282
|
+
ChatResponseLength = {
|
|
283
|
+
/** Standard response length. */
|
|
284
|
+
DEFAULT: 1,
|
|
285
|
+
/** Verbose, detailed responses. */
|
|
286
|
+
LONGER: 4,
|
|
287
|
+
/** Concise, brief responses. */
|
|
288
|
+
SHORTER: 5
|
|
289
|
+
};
|
|
265
290
|
ShareAccess = {
|
|
266
291
|
/** Only explicitly shared users can access */
|
|
267
292
|
RESTRICTED: 0,
|
|
@@ -784,6 +809,30 @@ var ArtifactsAPI = class {
|
|
|
784
809
|
const artifacts = await this.list(notebookId);
|
|
785
810
|
return artifacts.find((a) => a.id === artifactId) ?? null;
|
|
786
811
|
}
|
|
812
|
+
async listAudio(notebookId) {
|
|
813
|
+
return (await this.list(notebookId)).filter((a) => a.kind === "audio");
|
|
814
|
+
}
|
|
815
|
+
async listVideo(notebookId) {
|
|
816
|
+
return (await this.list(notebookId)).filter((a) => a.kind === "video");
|
|
817
|
+
}
|
|
818
|
+
async listReports(notebookId) {
|
|
819
|
+
return (await this.list(notebookId)).filter((a) => a.kind === "report");
|
|
820
|
+
}
|
|
821
|
+
async listQuizzes(notebookId) {
|
|
822
|
+
return (await this.list(notebookId)).filter((a) => a.kind === "quiz");
|
|
823
|
+
}
|
|
824
|
+
async listFlashcards(notebookId) {
|
|
825
|
+
return (await this.list(notebookId)).filter((a) => a.kind === "flashcards");
|
|
826
|
+
}
|
|
827
|
+
async listInfographics(notebookId) {
|
|
828
|
+
return (await this.list(notebookId)).filter((a) => a.kind === "infographic");
|
|
829
|
+
}
|
|
830
|
+
async listSlideDecks(notebookId) {
|
|
831
|
+
return (await this.list(notebookId)).filter((a) => a.kind === "slide_deck");
|
|
832
|
+
}
|
|
833
|
+
async listDataTables(notebookId) {
|
|
834
|
+
return (await this.list(notebookId)).filter((a) => a.kind === "data_table");
|
|
835
|
+
}
|
|
787
836
|
async delete(notebookId, artifactId) {
|
|
788
837
|
const params = [[2], notebookId, artifactId];
|
|
789
838
|
await this.rpc.call(RPCMethod.DELETE_ARTIFACT, params, {
|
|
@@ -1408,6 +1457,23 @@ var ChatAPI = class {
|
|
|
1408
1457
|
}
|
|
1409
1458
|
return null;
|
|
1410
1459
|
}
|
|
1460
|
+
/**
|
|
1461
|
+
* Low-level chat configuration. Set goal, response length, and optional
|
|
1462
|
+
* custom instructions directly. Persists on the server per notebook.
|
|
1463
|
+
* Use `setMode()` for preset combinations instead.
|
|
1464
|
+
*/
|
|
1465
|
+
async configure(notebookId, goal, length, customPrompt) {
|
|
1466
|
+
if (goal === ChatGoal.CUSTOM && !customPrompt) {
|
|
1467
|
+
throw new Error("customPrompt is required when goal is ChatGoal.CUSTOM");
|
|
1468
|
+
}
|
|
1469
|
+
const goalArray = goal === ChatGoal.CUSTOM ? [goal, customPrompt] : [goal];
|
|
1470
|
+
const chatSettings = [goalArray, [length]];
|
|
1471
|
+
const params = [notebookId, [[null, null, null, null, null, null, null, chatSettings]]];
|
|
1472
|
+
await this.rpc.call(RPCMethod.RENAME_NOTEBOOK, params, {
|
|
1473
|
+
sourcePath: `/notebook/${notebookId}`,
|
|
1474
|
+
allowNull: true
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1411
1477
|
/**
|
|
1412
1478
|
* Set the chat mode for a notebook. Persists on the server — affects all
|
|
1413
1479
|
* subsequent `ask()` calls until changed.
|
|
@@ -2119,6 +2185,44 @@ var SourcesAPI = class {
|
|
|
2119
2185
|
_typeCode: null
|
|
2120
2186
|
};
|
|
2121
2187
|
}
|
|
2188
|
+
async addDrive(notebookId, fileId, title, mimeType = DriveMimeType.GOOGLE_DOC, opts = {}) {
|
|
2189
|
+
const sourceData = [
|
|
2190
|
+
[fileId, mimeType, 1, title],
|
|
2191
|
+
null,
|
|
2192
|
+
null,
|
|
2193
|
+
null,
|
|
2194
|
+
null,
|
|
2195
|
+
null,
|
|
2196
|
+
null,
|
|
2197
|
+
null,
|
|
2198
|
+
null,
|
|
2199
|
+
null,
|
|
2200
|
+
1
|
|
2201
|
+
];
|
|
2202
|
+
const params = [
|
|
2203
|
+
[sourceData],
|
|
2204
|
+
notebookId,
|
|
2205
|
+
[2],
|
|
2206
|
+
[1, null, null, null, null, null, null, null, null, null, [1]]
|
|
2207
|
+
];
|
|
2208
|
+
const result = await this.rpc.call(RPCMethod.ADD_SOURCE, params, {
|
|
2209
|
+
sourcePath: `/notebook/${notebookId}`,
|
|
2210
|
+
allowNull: true
|
|
2211
|
+
});
|
|
2212
|
+
const sourceId = extractSourceId(result);
|
|
2213
|
+
if (opts.waitUntilReady) {
|
|
2214
|
+
return this.waitUntilReady(notebookId, sourceId, opts.waitTimeout);
|
|
2215
|
+
}
|
|
2216
|
+
return {
|
|
2217
|
+
id: sourceId,
|
|
2218
|
+
title,
|
|
2219
|
+
url: null,
|
|
2220
|
+
kind: "unknown",
|
|
2221
|
+
createdAt: null,
|
|
2222
|
+
status: "processing",
|
|
2223
|
+
_typeCode: null
|
|
2224
|
+
};
|
|
2225
|
+
}
|
|
2122
2226
|
async addFile(notebookId, filePath, mimeType, opts = {}) {
|
|
2123
2227
|
const fileData = readFileSync(filePath);
|
|
2124
2228
|
const fileName = filePath.split("/").pop() ?? "file";
|
|
@@ -2674,6 +2778,6 @@ var NotebookLMClient = class _NotebookLMClient {
|
|
|
2674
2778
|
init_enums();
|
|
2675
2779
|
init_errors();
|
|
2676
2780
|
|
|
2677
|
-
export { ArtifactDownloadError, ArtifactError, ArtifactNotFoundError, ArtifactNotReadyError, ArtifactParseError, ArtifactTypeCode, ArtifactsAPI, AudioFormat, AudioLength, AuthError, ChatAPI, ChatError, ChatMode, ClientError, ExportType, InfographicDetail, InfographicOrientation, InfographicStyle, NetworkError, NotebookError, NotebookLMClient, NotebookLMError, NotebookNotFoundError, NotebooksAPI, NotesAPI, QuizDifficulty, QuizQuantity, RPCError, RPCMethod, RPCTimeoutError, RateLimitError, ResearchAPI, ServerError, SettingsAPI, ShareAccess, SharePermission, ShareViewLevel, SharingAPI, SlideDeckFormat, SlideDeckLength, SourceAddError, SourceError, SourceNotFoundError, SourceProcessingError, SourceTimeoutError, SourcesAPI, VideoFormat, VideoStyle, connect };
|
|
2781
|
+
export { ArtifactDownloadError, ArtifactError, ArtifactNotFoundError, ArtifactNotReadyError, ArtifactParseError, ArtifactTypeCode, ArtifactsAPI, AudioFormat, AudioLength, AuthError, ChatAPI, ChatError, ChatGoal, ChatMode, ChatResponseLength, ClientError, DriveMimeType, ExportType, InfographicDetail, InfographicOrientation, InfographicStyle, NetworkError, NotebookError, NotebookLMClient, NotebookLMError, NotebookNotFoundError, NotebooksAPI, NotesAPI, QuizDifficulty, QuizQuantity, RPCError, RPCMethod, RPCTimeoutError, RateLimitError, ResearchAPI, ServerError, SettingsAPI, ShareAccess, SharePermission, ShareViewLevel, SharingAPI, SlideDeckFormat, SlideDeckLength, SourceAddError, SourceError, SourceNotFoundError, SourceProcessingError, SourceTimeoutError, SourcesAPI, VideoFormat, VideoStyle, connect };
|
|
2678
2782
|
//# sourceMappingURL=index.js.map
|
|
2679
2783
|
//# sourceMappingURL=index.js.map
|