Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,80 @@
],
"additionalProperties": false
}
},
{
"name": "notebooklm_get_source",
"description": "Gets details and content of a specific source document within a NotebookLM notebook.",
"parametersJsonSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"notebook_id": {
"type": "string",
"description": "The NotebookLM notebook ID. Extract this from the NotebookLM URL by taking the ID after \"https://notebooklm.google.com/notebook/\". For example, if the URL is \"https://notebooklm.google.com/notebook/abc123\", pass \"abc123\" as the notebook_id."
},
"source_id": {
"type": "string",
"description": "The ID of the source within the notebook."
},
"task_id": {
"type": "string"
},
"status_update": {
"type": "string",
"description": "A status update to show in the UI that provides more detail on the reason why this function was called.\n \n For example, \"Retrieving source document\", \"Reading file contents\", etc."
}
},
"required": [
"notebook_id",
"source_id",
"status_update"
],
"additionalProperties": false
},
"responseJsonSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"source": {
"type": "object",
"properties": {
"name": { "type": "string", "description": "The resource name of the source" },
"display_name": { "type": "string", "description": "The display name of the source" },
"state": { "type": "string", "description": "State of the source processing" },
"original_mime_type": { "type": "string", "description": "The original mime type of the source document" },
"user_drive_source_status": { "type": "string", "description": "The status of user drive source document" },
"user_raw_source": {
"type": "object",
"description": "Details and contents of the raw source document.",
"properties": {
"blobstore_content": {
"type": "object",
"description": "GCS blob details for the source document.",
"properties": {
"blob_id": { "type": "string", "description": "The unique ID of the source document stored in GCS." }
},
"required": [
"blob_id"
],
"additionalProperties": false
},
"serving_url": { "type": "string", "description": "The temporary serving URL of the source document." },
"download_url": { "type": "string", "description": "The download URL of the source document." }
},
"additionalProperties": false
}
},
"required": [
"name"
],
"additionalProperties": true
}
},
"required": [
"source"
],
"additionalProperties": false
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@ You have access to NotebookLM notebooks as knowledge sources. When the objective
references a NotebookLM notebook (indicated by a URL like
https://notebooklm.google.com/notebook/{notebook_id}), you can:

1. Use "notebooklm_generate_answer" to generate a comprehensive answer
to a question using the notebook's AI chat functionality. This is useful when
you need the notebook to synthesize information and provide a direct answer.
1. Use "notebooklm_generate_answer" to generate a comprehensive answer to a
question using the notebook's AI chat functionality. This is useful when you
need the notebook to synthesize information and provide a direct answer.

2. Use "notebooklm_retrieve_relevant_chunks" to retrieve relevant source
material from the notebook (text, images, or audio) based on a query. This is
useful when you want to retrieve source documents/content, not just get a
summary (use this like a RAG system for the notebook content). Each
retrieval is limited to a token budget, so it may be necessary to make multiple
more narrow queries if you need more information.
summary (use this like a RAG system for the notebook content). Each retrieval
is limited to a token budget, so it may be necessary to make multiple more
narrow queries if you need more information.

The URL format is "https://notebooklm.google.com/notebook/{notebook_id}" where
3. Use "notebooklm_get_source" to retrieve to retrieve complete source material
from the notebook (text, images, or audio) that was referenced in the query.
This is useful when you want to retrieve the complete source
documents/content, not just get a small chunk of the source.

The URL format is "https://notebooklm.google.com/notebook/{notebook_id}" where
"{notebook_id}" is the ID you should pass to the function.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
},
{
"name": "notebooklm_generate_answer"
},
{
"name": "notebooklm_get_source"
}
]
128 changes: 126 additions & 2 deletions packages/visual-editor/src/a2/agent/functions/generated/notebooklm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@ export type NotebooklmGenerateAnswerResponse = {
answer: string;
};

export type NotebooklmGetSourceParams = {
notebook_id: string;
source_id: string;
task_id?: string;
status_update: string;
};

export type NotebooklmGetSourceResponse = {
source: {
name: string;
display_name?: string;
state?: string;
original_mime_type?: string;
user_drive_source_status?: string;
user_raw_source?: {
blobstore_content?: {
blob_id: string;
};
serving_url?: string;
download_url?: string;
};
};
};

export const declarations: FunctionDeclaration[] = [
{
"name": "notebooklm_retrieve_relevant_chunks",
Expand Down Expand Up @@ -165,12 +189,112 @@ export const declarations: FunctionDeclaration[] = [
],
"additionalProperties": false
}
},
{
"name": "notebooklm_get_source",
"description": "Gets details and content of a specific source document within a NotebookLM notebook.",
"parametersJsonSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"notebook_id": {
"type": "string",
"description": "The NotebookLM notebook ID. Extract this from the NotebookLM URL by taking the ID after \"https://notebooklm.google.com/notebook/\". For example, if the URL is \"https://notebooklm.google.com/notebook/abc123\", pass \"abc123\" as the notebook_id."
},
"source_id": {
"type": "string",
"description": "The ID of the source within the notebook."
},
"task_id": {
"type": "string"
},
"status_update": {
"type": "string",
"description": "A status update to show in the UI that provides more detail on the reason why this function was called.\n \n For example, \"Retrieving source document\", \"Reading file contents\", etc."
}
},
"required": [
"notebook_id",
"source_id",
"status_update"
],
"additionalProperties": false
},
"responseJsonSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"source": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The resource name of the source"
},
"display_name": {
"type": "string",
"description": "The display name of the source"
},
"state": {
"type": "string",
"description": "State of the source processing"
},
"original_mime_type": {
"type": "string",
"description": "The original mime type of the source document"
},
"user_drive_source_status": {
"type": "string",
"description": "The status of user drive source document"
},
"user_raw_source": {
"type": "object",
"description": "Details and contents of the raw source document.",
"properties": {
"blobstore_content": {
"type": "object",
"description": "GCS blob details for the source document.",
"properties": {
"blob_id": {
"type": "string",
"description": "The unique ID of the source document stored in GCS."
}
},
"required": [
"blob_id"
],
"additionalProperties": false
},
"serving_url": {
"type": "string",
"description": "The temporary serving URL of the source document."
},
"download_url": {
"type": "string",
"description": "The download URL of the source document."
}
},
"additionalProperties": false
}
},
"required": [
"name"
],
"additionalProperties": true
}
},
"required": [
"source"
],
"additionalProperties": false
}
}
];

export const metadata: Record<string, { icon?: string; title?: string }> = {
"notebooklm_retrieve_relevant_chunks": {},
"notebooklm_generate_answer": {}
"notebooklm_generate_answer": {},
"notebooklm_get_source": {}
};

export const instruction: string = "## Using NotebookLM\n\nYou have access to NotebookLM notebooks as knowledge sources. When the objective\nreferences a NotebookLM notebook (indicated by a URL like\nhttps://notebooklm.google.com/notebook/{notebook_id}), you can:\n\n1. Use \"notebooklm_generate_answer\" to generate a comprehensive answer \n to a question using the notebook's AI chat functionality. This is useful when \n you need the notebook to synthesize information and provide a direct answer.\n\n2. Use \"notebooklm_retrieve_relevant_chunks\" to retrieve relevant source\n material from the notebook (text, images, or audio) based on a query. This is\n useful when you want to retrieve source documents/content, not just get a\n summary (use this like a RAG system for the notebook content). Each\n retrieval is limited to a token budget, so it may be necessary to make multiple\n more narrow queries if you need more information.\n\nThe URL format is \"https://notebooklm.google.com/notebook/{notebook_id}\" where \n\"{notebook_id}\" is the ID you should pass to the function.";
export const instruction: string = "## Using NotebookLM\n\nYou have access to NotebookLM notebooks as knowledge sources. When the objective\nreferences a NotebookLM notebook (indicated by a URL like\nhttps://notebooklm.google.com/notebook/{notebook_id}), you can:\n\n1. Use \"notebooklm_generate_answer\" to generate a comprehensive answer to a\n question using the notebook's AI chat functionality. This is useful when you\n need the notebook to synthesize information and provide a direct answer.\n\n2. Use \"notebooklm_retrieve_relevant_chunks\" to retrieve relevant source\n material from the notebook (text, images, or audio) based on a query. This is\n useful when you want to retrieve source documents/content, not just get a\n summary (use this like a RAG system for the notebook content). Each retrieval\n is limited to a token budget, so it may be necessary to make multiple more\n narrow queries if you need more information.\n\n3. Use \"notebooklm_get_source\" to retrieve to retrieve complete source material\n from the notebook (text, images, or audio) that was referenced in the query.\n This is useful when you want to retrieve the complete source\n documents/content, not just get a small chunk of the source.\n\nThe URL format is \"https://notebooklm.google.com/notebook/{notebook_id}\" where\n\"{notebook_id}\" is the ID you should pass to the function.";
Loading
Loading