Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/lfnovo/open-notebook
/ functions
Functions
1,250 in github.com/lfnovo/open-notebook
⨍
Functions
1,250
◇
Types & classes
422
↳
Endpoints
144
↓ 541 callers
Method
get
(cls: Type[T], id: str)
open_notebook/domain/base.py:103
↓ 125 callers
Function
useTranslation
()
frontend/src/lib/hooks/use-translation.ts:9
↓ 112 callers
Function
cn
(...inputs: ClassValue[])
frontend/src/lib/utils.ts:4
↓ 88 callers
Function
repo_query
Execute a SurrealQL query and return the results
open_notebook/database/repository.py:65
↓ 67 callers
Function
ensure_record_id
Ensure a value is a RecordID.
open_notebook/database/repository.py:40
↓ 53 callers
Method
_make_request
Make HTTP request to the API.
api/client.py:48
↓ 52 callers
Method
delete
Delete source and clean up associated file, embeddings, and insights.
open_notebook/domain/notebook.py:582
↓ 43 callers
Function
useToast
()
frontend/src/lib/hooks/use-toast.ts:10
↓ 38 callers
Method
save
Save the note and submit embedding command. Overrides ObjectModel.save() to submit an async embed_note command after saving,
open_notebook/domain/notebook.py:636
↓ 32 callers
Function
validate_url
Validate URL format for API endpoints. This is a self-hosted application, so we allow: - Private IPs (10.x, 172.16-31.x, 192.168.x) for
api/credentials_service.py:92
↓ 31 callers
Function
getApiErrorKey
(errorOrMessage: unknown, fallbackKey?: string)
frontend/src/lib/utils/error-handler.ts:34
↓ 30 callers
Method
from_file
Create migration from SQL file.
open_notebook/database/async_migrate.py:23
↓ 26 callers
Function
src
(id: string, insights_count = 0)
frontend/src/lib/utils/source-context.test.ts:11
↓ 24 callers
Function
getApiErrorMessage
( errorOrMessage: unknown, t: (key: string) => string, fallbackKey?: string )
frontend/src/lib/utils/error-handler.ts:59
↓ 22 callers
Function
detect_content_type_from_extension
Detect content type from file extension. Args: file_path: Path to the file (can be full path or just filename) Returns:
open_notebook/utils/chunking.py:173
↓ 21 callers
Function
classify_model_type
Classify a model into a type based on its name and provider. Returns one of: language, embedding, speech_to_text, text_to_speech
open_notebook/ai/model_discovery.py:157
↓ 17 callers
Function
token_count
Count the number of tokens in the input string using the 'o200k_base' encoding. Args: input_string (str): The input string to count
open_notebook/utils/token_utils.py:15
↓ 16 callers
Function
chunk_text
Split text into chunks using appropriate splitter for content type. Args: text: The text to chunk content_type: Optional exp
open_notebook/utils/chunking.py:418
↓ 15 callers
Method
get_context
( self, context_size: Literal["short", "long"] = "short" )
open_notebook/domain/notebook.py:666
↓ 15 callers
Method
update
(self)
open_notebook/domain/base.py:323
↓ 13 callers
Method
get
Override get() to handle api_key decryption.
open_notebook/domain/credential.py:156
↓ 12 callers
Function
get_command_id
Extract command_id from input_data's execution context, or return 'unknown'.
commands/embedding_commands.py:27
↓ 10 callers
Function
classify_error
Classify a raw exception into a user-friendly error type and message. Args: exception: Any exception from LLM providers/Esperanto/La
open_notebook/utils/error_classifier.py:72
↓ 10 callers
Function
compare_versions
Compare two semantic versions. Args: version1 (str): First version string version2 (str): Second version string Returns
open_notebook/utils/version_utils.py:132
↓ 10 callers
Function
generate_embeddings
Generate embeddings for multiple texts with automatic batching and retry. Texts are split into batches of EMBEDDING_BATCH_SIZE to avoid exce
open_notebook/utils/embedding.py:111
↓ 10 callers
Method
search
Search the knowledge base.
api/client.py:117
↓ 10 callers
Function
useModalManager
()
frontend/src/lib/hooks/use-modal-manager.ts:7
↓ 9 callers
Function
_cors_headers
Build CORS headers for error responses. Mirrors Starlette CORSMiddleware behavior: reflects the request Origin when the origin is allowe
api/main.py:67
↓ 9 callers
Function
computeSourceSelections
( existing: Record<string, ContextMode>, sources: SourceLike[], defaultMode: SourceContextDefault = 'inc
frontend/src/lib/utils/source-context.ts:56
↓ 9 callers
Function
detect_content_type_from_heuristics
Detect content type using content heuristics. Args: text: The text content to analyze Returns: Tuple of (ContentType, c
open_notebook/utils/chunking.py:195
↓ 9 callers
Function
generate_embedding
Generate a single embedding for text, handling large content via chunking and mean pooling. For short text (<= CHUNK_SIZE tokens): -
open_notebook/utils/embedding.py:209
↓ 9 callers
Method
get
(self, url, headers=None, timeout=None)
tests/test_credentials_api.py:118
↓ 9 callers
Function
getApiUrl
()
frontend/src/lib/config.ts:22
↓ 9 callers
Method
get_all
(cls: Type[T], order_by=None)
open_notebook/domain/base.py:39
↓ 9 callers
Method
get_by_provider
Get all credentials for a provider.
open_notebook/domain/credential.py:140
↓ 9 callers
Function
provision_langchain_model
Returns the best model to use based on the context size and on whether there is a specific model being requested in Config. If context > 105_
open_notebook/ai/provision.py:10
↓ 9 callers
Function
provision_provider_keys
Provision environment variables from database for a specific provider. This function checks if the provider has a Credential record stored i
open_notebook/ai/key_provider.py:246
↓ 9 callers
Method
run
Run the migration.
open_notebook/database/async_migrate.py:36
↓ 8 callers
Function
build_episode_output_dir
Build a filesystem-safe output directory path for a podcast episode. Uses a UUID as the directory name so the path is safe regardless of what
commands/podcast_commands.py:26
↓ 8 callers
Function
clean_thinking_content
Remove thinking content from AI responses, returning only the cleaned content. This is a convenience function for cases where you only need
open_notebook/utils/text_utils.py:100
↓ 8 callers
Function
getDateLocale
(language: string)
frontend/src/lib/utils/date-locale.ts:30
↓ 8 callers
Method
get_instance
Get or create the singleton instance and load from DB
open_notebook/domain/base.py:308
↓ 8 callers
Function
note
(id: string)
frontend/src/lib/utils/source-context.test.ts:12
↓ 8 callers
Function
parse_thinking_content
Parse message content to extract thinking content from <think> tags. Handles both well-formed tags and malformed output where the opening
open_notebook/utils/text_utils.py:42
↓ 8 callers
Method
to_esperanto_config
Build config dict for AIFactory.create_*() calls. Returns a dict that can be passed as the 'config' parameter to Esperanto's
open_notebook/domain/credential.py:102
↓ 7 callers
Function
_resolve_model_config
Load Model record, resolve credential -> (provider, model_name, config_dict). Used by resolve_outline_config, resolve_transcript_config, resolve_
open_notebook/podcasts/models.py:11
↓ 7 callers
Function
bulkModeForSource
( mode: SourceContextDefault, insightsCount: number, )
frontend/src/lib/utils/source-context.ts:29
↓ 7 callers
Function
detect_content_type
Detect content type using file extension (primary) and heuristics (fallback). Strategy: 1. If file extension is available and recognized
open_notebook/utils/chunking.py:322
↓ 7 callers
Function
extract_text_content
Extract text from LLM response content. Handles both plain string responses and structured content formats (e.g. Gemini's envelope format):
open_notebook/utils/text_utils.py:122
↓ 7 callers
Function
get_secret_from_env
Get a secret from environment, supporting Docker secrets pattern. Checks for VAR_FILE first (Docker secrets), then falls back to VAR. A
open_notebook/utils/encryption.py:29
↓ 7 callers
Function
mean_pool_embeddings
Combine multiple embeddings into a single embedding using mean pooling. Algorithm: 1. Normalize each embedding to unit length 2. Com
open_notebook/utils/embedding.py:55
↓ 7 callers
Method
render
()
frontend/src/components/common/ErrorBoundary.tsx:48
↓ 7 callers
Function
useModels
()
frontend/src/lib/hooks/use-models.ts:16
↓ 7 callers
Function
useNotebooks
(archived?: boolean)
frontend/src/lib/hooks/use-notebooks.ts:9
↓ 6 callers
Function
_build_text_exceeding_tokens
Build text that exceeds a token threshold.
tests/test_chunking.py:31
↓ 6 callers
Function
_check_provider_has_credential
Check if a provider has any credentials configured in the database.
api/routers/models.py:115
↓ 6 callers
Function
_handle_value_error
Convert a ValueError from the service layer to an HTTPException.
api/routers/credentials.py:63
↓ 6 callers
Method
_prepare_save_data
Override to encrypt api_key and sync provider extras into `config`.
open_notebook/domain/credential.py:227
↓ 6 callers
Function
applyBulkSourceContext
( existing: Record<string, ContextMode>, sources: SourceLike[], action: SourceContextDefault, )
frontend/src/lib/utils/source-context.ts:77
↓ 6 callers
Function
full_model_dump
(model)
commands/podcast_commands.py:40
↓ 6 callers
Method
get_by_name
Get episode profile by name
open_notebook/podcasts/models.py:116
↓ 6 callers
Method
get_embedding_model
Get the default embedding model
open_notebook/ai/models.py:209
↓ 6 callers
Function
get_latest_version
Get the latest version from the migrations table.
open_notebook/database/async_migrate.py:204
↓ 6 callers
Method
get_model
Get a model by ID. Esperanto will cache the actual model instance.
open_notebook/ai/models.py:102
↓ 6 callers
Method
vectorize
Submit vectorization as a background job using the embed_source command. This method leverages the job-based architecture to prevent
open_notebook/domain/notebook.py:477
↓ 5 callers
Function
_assert_chunks_within_token_limit
Assert chunks stay within the configured token window.
tests/test_chunking.py:39
↓ 5 callers
Function
_check_azure_support
Check if Azure OpenAI provider is available for a specific mode. Args: mode: One of 'LLM', 'EMBEDDING', 'STT', 'TTS' Returns:
api/routers/models.py:125
↓ 5 callers
Function
_check_openai_compatible_support
Check if OpenAI-compatible provider is available for a specific mode. Args: mode: One of 'LLM', 'EMBEDDING', 'STT', 'TTS' Retur
api/routers/models.py:152
↓ 5 callers
Function
_get_default_credential
Get the first credential for a provider from the database.
open_notebook/ai/key_provider.py:76
↓ 5 callers
Function
_profile_to_response
(profile: SpeakerProfile)
api/routers/speaker_profiles.py:23
↓ 5 callers
Function
_profile_to_response
(profile: EpisodeProfile)
api/routers/episode_profiles.py:29
↓ 5 callers
Function
_resolve_audio_path
(audio_file: str)
api/routers/podcasts.py:34
↓ 5 callers
Function
credential_to_response
Convert a Credential domain object to API response.
api/credentials_service.py:208
↓ 5 callers
Function
db_connection
()
open_notebook/database/repository.py:48
↓ 5 callers
Method
get_current_version
Get current database version.
open_notebook/database/async_migrate.py:177
↓ 5 callers
Method
get_defaults
Get the default models configuration from database
open_notebook/ai/models.py:178
↓ 5 callers
Method
get_linked_models
Get all models linked to this credential.
open_notebook/domain/credential.py:215
↓ 5 callers
Function
openModal
(type: ModalType, id: string)
frontend/src/lib/hooks/use-modal-manager.ts:21
↓ 5 callers
Method
relate
( self, relationship: str, target_id: str, data: Optional[Dict] = {} )
open_notebook/domain/base.py:217
↓ 5 callers
Method
submit_command_job
Submit a generic command job for background processing
api/command_service.py:11
↓ 4 callers
Function
_get_size_metrics
()
open_notebook/utils/embedding.py:149
↓ 4 callers
Method
build
Build context based on provided parameters. Returns: Dict containing the built context with metadata
open_notebook/utils/context_builder.py:105
↓ 4 callers
Function
computeNoteSelections
( existing: Record<string, ContextMode>, notes: NoteLike[], defaultAction: NoteContextDefault = 'include
frontend/src/lib/utils/source-context.ts:112
↓ 4 callers
Function
decrypt_value
Decrypt a Fernet-encrypted string value. Handles graceful fallback for legacy unencrypted data. Args: value: The encrypted stri
open_notebook/utils/encryption.py:167
↓ 4 callers
Function
getConfig
()
frontend/src/lib/config.ts:43
↓ 4 callers
Method
get_context
Build long-form notebook context for podcast and LLM workflows. Normal list retrieval omits large source/note bodies, so this method
open_notebook/domain/notebook.py:69
↓ 4 callers
Method
get_embedded_chunks
(self)
open_notebook/domain/notebook.py:442
↓ 4 callers
Method
get_episode
Get a specific podcast episode
api/podcast_service.py:153
↓ 4 callers
Method
get_insights
(self)
open_notebook/domain/notebook.py:458
↓ 4 callers
Method
get_notes
Get all notes with optional notebook filtering.
api/client.py:251
↓ 4 callers
Function
get_session_message_count
Get message count from LangGraph state, returns 0 on error.
open_notebook/utils/graph_utils.py:7
↓ 4 callers
Function
handleChange
(key: keyof ModelDefaults, value: string)
frontend/src/app/(dashboard)/settings/api-keys/page.tsx:1149
↓ 4 callers
Function
handleContextModeChange
(itemId: string, mode: ContextMode, type: 'source' | 'note')
frontend/src/app/(dashboard)/notebooks/[id]/page.tsx:96
↓ 4 callers
Function
handleSubmit
(e: React.FormEvent)
frontend/src/components/auth/LoginForm.tsx:128
↓ 4 callers
Function
parse_record_ids
Recursively parse and convert RecordIDs into strings.
open_notebook/database/repository.py:29
↓ 4 callers
Function
require_encryption_key
Raise ValueError if encryption key is not configured.
api/credentials_service.py:199
↓ 4 callers
Function
save_source
(state: SourceState)
open_notebook/graphs/source.py:110
↓ 4 callers
Function
scrollToSelectedRow
(index: number)
frontend/src/app/(dashboard)/sources/page.tsx:147
↓ 4 callers
Function
toggleSection
(section: string)
frontend/src/app/(dashboard)/settings/components/SettingsForm.tsx:56
↓ 3 callers
Method
_add_source_context
Add source and its insights to context. Args: source_id: ID of the source inclusion_level: "insights", "full
open_notebook/utils/context_builder.py:142
next →
1–100 of 1,250, ranked by callers