api

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the main API client for NotebookLM.

func Authenticate

func Authenticate() (*Client, error)

Authenticate loads saved auth state and creates a client.

func NewClient

func NewClient(tokens *auth.AuthTokens) *Client

NewClient creates a new API client from auth tokens.

func (*Client) AddSourceFile

func (c *Client) AddSourceFile(notebookID, filePath string) (*model.Source, error)

AddSourceFile uploads a file as a source to a notebook (3-step resumable upload).

func (*Client) AddSourceText

func (c *Client) AddSourceText(notebookID, title, content string) (*model.Source, error)

AddSourceText adds a text/paste source to a notebook.

func (*Client) AddSourceURL

func (c *Client) AddSourceURL(notebookID, sourceURL string) (*model.Source, error)

AddSourceURL adds a URL source to a notebook.

func (*Client) Ask

func (c *Client) Ask(notebookID, question string, sourceIDs []string) (*model.AskResult, error)

Ask sends a question to the notebook and returns the AI response.

func (*Client) CreateArtifact

func (c *Client) CreateArtifact(notebookID string, typeCode rpc.ArtifactTypeCode) (*model.Artifact, error)

CreateArtifact creates a new artifact (report, quiz, etc.).

func (*Client) CreateNote

func (c *Client) CreateNote(notebookID, title, content string) (*model.Note, error)

CreateNote creates a new note in the notebook.

func (*Client) CreateNotebook

func (c *Client) CreateNotebook(title string) (*model.Notebook, error)

CreateNotebook creates a new notebook with the given title.

func (*Client) DeleteArtifact

func (c *Client) DeleteArtifact(notebookID, artifactID string) error

DeleteArtifact deletes an artifact.

func (*Client) DeleteNote

func (c *Client) DeleteNote(notebookID, noteID string) error

DeleteNote deletes a note.

func (*Client) DeleteNotebook

func (c *Client) DeleteNotebook(notebookID string) error

DeleteNotebook deletes a notebook by ID.

func (*Client) DeleteSource

func (c *Client) DeleteSource(notebookID, sourceID string) error

DeleteSource removes a source from a notebook.

func (*Client) GenerateAudio

func (c *Client) GenerateAudio(notebookID string, instructions string) (*model.Artifact, error)

GenerateAudio generates an audio overview for the notebook.

func (*Client) GetArtifact

func (c *Client) GetArtifact(notebookID, artifactID string) (*model.Artifact, error)

GetArtifact returns artifact details including content.

func (*Client) GetChatHistory

func (c *Client) GetChatHistory(notebookID string) ([]model.ChatEntry, error)

GetChatHistory returns recent conversation turns for a notebook.

func (*Client) GetNotebook

func (c *Client) GetNotebook(notebookID string) (*model.Notebook, error)

GetNotebook gets details about a specific notebook.

func (*Client) GetSharing

func (c *Client) GetSharing(notebookID string) (*ShareStatus, error)

GetSharing returns the current sharing status.

func (*Client) GetSource

func (c *Client) GetSource(notebookID, sourceID string) (*model.Source, error)

GetSource gets details about a specific source (via list + filter).

func (*Client) ImportResearch

func (c *Client) ImportResearch(notebookID, researchID string) error

ImportResearch imports research results as a source.

func (*Client) ListArtifacts

func (c *Client) ListArtifacts(notebookID string) ([]model.Artifact, error)

ListArtifacts returns all artifacts in a notebook.

func (*Client) ListNotebooks

func (c *Client) ListNotebooks() ([]model.Notebook, error)

ListNotebooks returns all notebooks for the authenticated user.

func (*Client) ListNotes

func (c *Client) ListNotes(notebookID string) ([]model.Note, error)

ListNotes returns all notes in a notebook.

func (*Client) ListSources

func (c *Client) ListSources(notebookID string) ([]model.Source, error)

ListSources returns all sources in a notebook.

func (*Client) PollResearch

func (c *Client) PollResearch(notebookID, researchID string) (*ResearchResult, error)

PollResearch checks the progress of a research task.

func (*Client) RefreshSource

func (c *Client) RefreshSource(notebookID, sourceID string) error

RefreshSource refreshes a source.

func (*Client) RenameNotebook

func (c *Client) RenameNotebook(notebookID, newTitle string) error

RenameNotebook renames a notebook.

func (*Client) SetSharing

func (c *Client) SetSharing(notebookID string, permission model.SharePermission) error

SetSharing sets the sharing permissions for a notebook.

func (*Client) StartResearch

func (c *Client) StartResearch(notebookID, query string) (*ResearchResult, error)

StartResearch initiates a deep research task.

func (*Client) UpdateNote

func (c *Client) UpdateNote(notebookID, noteID, title, content string) (*model.Note, error)

UpdateNote updates an existing note.

func (*Client) WaitForArtifact

func (c *Client) WaitForArtifact(notebookID, artifactID string, timeout time.Duration) (*model.Artifact, error)

WaitForArtifact polls until an artifact is ready.

func (*Client) WaitForSource

func (c *Client) WaitForSource(notebookID, sourceID string, timeout time.Duration) (*model.Source, error)

WaitForSource polls until a source is ready.

type Error

type Error struct {
	Op      string
	Message string
	Err     error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ResearchResult

type ResearchResult struct {
	ID       string `json:"id"`
	Status   string `json:"status"`
	Progress int    `json:"progress"`
	Content  string `json:"content,omitempty"`
}

ResearchResult holds the result of a deep research operation.

type ShareStatus

type ShareStatus struct {
	IsShared   bool                  `json:"is_shared"`
	Permission model.SharePermission `json:"permission"`
	ShareURL   string                `json:"share_url,omitempty"`
}

ShareStatus holds the sharing state of a notebook.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL