Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chatbi/chatbi
/ functions
Functions
811 in github.com/chatbi/chatbi
⨍
Functions
811
◇
Types & classes
325
↳
Endpoints
45
↓ 2 callers
Method
get_by_id
Get entity by ID asynchronously. Args: id_value: Primary key value Returns: Entity or None if not f
chatbi/domain/common/repository.py:420
↓ 2 callers
Method
get_by_username
根据用户名获取用户
chatbi/domain/auth/repository.py:33
↓ 2 callers
Method
get_chat_session_by_id
Get chat session by ID asynchronously. Args: id: Chat session ID Returns: Chat session if found, No
chatbi/domain/chat/repository.py:301
↓ 2 callers
Method
get_connection
Get a database connection with proper lifecycle management. Args: db_type: Database type enum connection_inf
chatbi/database/connection_manager.py:100
↓ 2 callers
Method
get_connection
Get the current connection or create a new one if needed. Returns: A DuckDB connection Raises: Data
chatbi/database/drivers/duckdb_adapter.py:94
↓ 2 callers
Method
get_datasource_by_id
Get datasource by ID. Args: datasource_id: Datasource ID Returns: Datasource or None if not found
chatbi/domain/datasource/repository.py:185
↓ 2 callers
Method
get_schema_metadata
Get schema metadata with enhanced caching support. Uses the repository pattern and optimized ConnectionManager with improved
chatbi/domain/datasource/service.py:565
↓ 2 callers
Method
get_table_schema
Get the database schema. Args: datasource_id: Optional ID of specific datasource to fetch schema from Returns:
chatbi/domain/chat/service.py:251
↓ 2 callers
Function
handleLoadQuery
(query: string)
web/src/pages/DataSource/Query.tsx:160
↓ 2 callers
Function
handleQuery
(id: string)
web/src/pages/DataSource/index.tsx:64
↓ 2 callers
Method
hash_password
生成密码哈希
chatbi/domain/auth/models.py:30
↓ 2 callers
Method
is_expired
Check if session has expired
chatbi/pipelines/ask/session_manager.py:75
↓ 2 callers
Function
obj_to_base64
Convert a dictionary object to a base64-encoded string. This function serializes a dictionary object to a JSON-formatted byte string using th
chatbi/utils.py:85
↓ 2 callers
Method
replay
(self, **kwargs)
chatbi/agent/agent_base.py:14
↓ 2 callers
Method
run_sql
Run SQL query and return results. Args: request: FastAPI request object id: ChatSession ID sql:
chatbi/domain/chat/service.py:741
↓ 2 callers
Function
scrollToBottom
(behavior: ScrollBehavior = 'smooth')
web/src/pages/Playground/index.tsx:244
↓ 2 callers
Method
session
Context manager for SQLAlchemy sessions. Yields: SQLAlchemy session with automatic commit/rollback Example:
chatbi/database/database.py:227
↓ 2 callers
Method
to_dict
Convert data source to dictionary representation. Args: include_secrets: Whether to include secret values (default: Fals
chatbi/domain/datasource/models.py:316
↓ 2 callers
Method
to_dict
Convert model instance to dictionary. Returns: Dictionary representation of model
chatbi/domain/common/entities.py:47
↓ 2 callers
Method
update_datasource_last_used
Update the last_used_at timestamp for a datasource. Args: datasource_id: ID of the datasource to update Returns
chatbi/domain/datasource/repository.py:123
↓ 2 callers
Function
with_async_db_retry
Retry async database operations on connection errors. Args: coro_func: Async function to execute max_retries: Maximum number
chatbi/database/database.py:158
↓ 1 callers
Method
_async_count
Count total number of entities asynchronously.
chatbi/domain/common/repository.py:87
↓ 1 callers
Method
_async_create
Create new entity asynchronously.
chatbi/domain/common/repository.py:98
↓ 1 callers
Method
_async_delete
Delete entity by ID asynchronously.
chatbi/domain/common/repository.py:146
↓ 1 callers
Method
_async_get_all
Get all entities with pagination asynchronously.
chatbi/domain/common/repository.py:76
↓ 1 callers
Method
_async_update
Update existing entity asynchronously.
chatbi/domain/common/repository.py:122
↓ 1 callers
Method
_auto_detect_chart
Auto-detect chart type based on data structure Args: query_metadata: Query Metadata result_data: Result data
chatbi/agent/chart_agent.py:231
↓ 1 callers
Method
_check_window
Check rate limit for a specific time window. Args: identifier: Unique identifier (user:xxx or ip:xxx) window_
chatbi/middleware/enhanced_rate_limiter.py:137
↓ 1 callers
Method
_check_window_redis
Check rate limit using Redis (sliding window with sorted sets). Redis keys: ratelimit:{identifier}:{window} Sorted set: times
chatbi/middleware/enhanced_rate_limiter.py:164
↓ 1 callers
Method
_cleanup_check
Check if we need to clean up idle connections.
chatbi/database/drivers/sqlite_adapter.py:118
↓ 1 callers
Method
_cleanup_records
Clean up stale records and enforce maximum tracked clients. This prevents memory growth by: 1. Removing records for clients
chatbi/middleware/rate_limiter.py:268
↓ 1 callers
Method
_create_access_token
生成 Access Token
chatbi/domain/auth/service.py:202
↓ 1 callers
Method
_create_connection
Create a new SQLite connection with optimized settings.
chatbi/database/drivers/sqlite_adapter.py:89
↓ 1 callers
Method
_create_refresh_token
生成 Refresh Token
chatbi/domain/auth/service.py:216
↓ 1 callers
Method
_execute_sql_core
Internal method to execute SQL, serialize results, and handle basics.
chatbi/domain/chat/service.py:668
↓ 1 callers
Method
_extract_json
Extract JSON from LLM response
chatbi/agent/chart_agent.py:369
↓ 1 callers
Method
_format_context
Format search results into LLM-friendly context
chatbi/pipelines/retrieval/mdl_retrieval.py:144
↓ 1 callers
Method
_format_results
Format search results as string
chatbi/pipelines/retrieval/history_retrieval.py:198
↓ 1 callers
Method
_generate_embedding
Generate embedding vector for text using LLM provider
chatbi/pipelines/retrieval/mdl_retrieval.py:86
↓ 1 callers
Method
_generate_point_id
Generate deterministic point ID from question ID
chatbi/pipelines/retrieval/history_retrieval.py:193
↓ 1 callers
Method
_get_clarification_message
Get clarification request message
chatbi/pipelines/ask/ask_pipeline.py:252
↓ 1 callers
Method
_get_client_identifier
Generate a unique identifier for the client based on IP and other attributes. This creates a composite key that can distinguish betw
chatbi/middleware/rate_limiter.py:173
↓ 1 callers
Method
_get_client_ip
Extract client IP from request (considering proxies). Args: request: FastAPI request Returns:
chatbi/middleware/enhanced_rate_limiter.py:250
↓ 1 callers
Method
_get_oldest_valid_timestamp
Get the oldest timestamp still in the current window
chatbi/middleware/rate_limiter.py:246
↓ 1 callers
Method
_get_prompt
Generate chart generation prompt
chatbi/agent/chart_agent.py:32
↓ 1 callers
Method
_get_remaining_requests
Get remaining requests allowed in the current window
chatbi/middleware/rate_limiter.py:232
↓ 1 callers
Function
_handle_error
(validation_error: pydantic.ValidationError)
chatbi/agent/validator/type_validator.py:50
↓ 1 callers
Method
_handle_non_query
Handle non-query intents
chatbi/pipelines/ask/ask_pipeline.py:216
↓ 1 callers
Method
_is_connection_valid
Check if connection is valid and responsive with timeout.
chatbi/database/drivers/sqlite_adapter.py:80
↓ 1 callers
Method
_is_rate_limited
Check if client has exceeded rate limit using sliding window algorithm. Args: client_id: Unique client identifier
chatbi/middleware/rate_limiter.py:206
↓ 1 callers
Method
_is_retryable_error
Determine if an error is potentially transient and retryable. Args: error: The exception to check Returns:
chatbi/database/connection_manager.py:141
↓ 1 callers
Method
_search_mdl
Search Qdrant for similar MDL documents
chatbi/pipelines/retrieval/mdl_retrieval.py:112
↓ 1 callers
Method
_should_use_llm
Determine if LLM is needed for chart selection
chatbi/agent/chart_agent.py:330
↓ 1 callers
Function
_to_datetime_and_format
(series: pd.Series)
chatbi/utils.py:18
↓ 1 callers
Function
_to_json_obj
(df: pd.DataFrame)
chatbi/utils.py:30
↓ 1 callers
Method
add_chat_message
Add a new chat message. Args: message_data: Dictionary containing message attributes Returns: Creat
chatbi/domain/chat/repository.py:94
↓ 1 callers
Function
add_error_handlers
Register all exception handlers with the FastAPI app.
chatbi/middleware/error_handler.py:444
↓ 1 callers
Method
add_message
Add a message to session
chatbi/pipelines/ask/session_manager.py:39
↓ 1 callers
Function
apiInit
()
web/scripts/api-init.ts:25
↓ 1 callers
Function
auto_discover_adapters
Auto-discover and register database adapters. This function finds all adapter classes in the current package that follow the naming conv
chatbi/database/drivers/factory.py:390
↓ 1 callers
Function
check_db_exists
Check if the database exists.
chatbi/migrations/manage_migrations.py:65
↓ 1 callers
Method
check_health
Check async database connection health. Returns: Dictionary with health check results
chatbi/database/database.py:566
↓ 1 callers
Function
check_rate_limit_dependency
FastAPI dependency for checking rate limits. Usage: ```python @router.post("/api/v1/ask", dependencies=[Depends(check_rate_li
chatbi/dependencies.py:432
↓ 1 callers
Method
clear
Clear all cache entries.
chatbi/cache/base.py:80
↓ 1 callers
Method
close
Close the database connection.
chatbi/database/drivers/duckdb_adapter.py:329
↓ 1 callers
Method
close
Close the database connection and cleanup resources. Raises: DatabaseError: If connection cannot be closed properly
chatbi/database/drivers/base.py:106
↓ 1 callers
Function
close_all_connections
Close all database connections.
chatbi/database/drivers/factory.py:372
↓ 1 callers
Method
close_all_connections
Close all connections in the pool.
chatbi/database/drivers/factory.py:240
↓ 1 callers
Function
close_database
Close all database connections properly. This function should be called during application shutdown. Returns: bool: True if cle
chatbi/database/database.py:707
↓ 1 callers
Function
cmd_create
Create a new migration.
chatbi/migrations/manage_migrations.py:148
↓ 1 callers
Function
cmd_downgrade
Downgrade by a specific number of steps.
chatbi/migrations/manage_migrations.py:165
↓ 1 callers
Function
cmd_history
Show migration history.
chatbi/migrations/manage_migrations.py:170
↓ 1 callers
Function
cmd_reset
Reset the database.
chatbi/migrations/manage_migrations.py:175
↓ 1 callers
Function
cmd_status
Show current migration status.
chatbi/migrations/manage_migrations.py:133
↓ 1 callers
Function
cmd_upgrade
Upgrade to a specific version or head.
chatbi/migrations/manage_migrations.py:160
↓ 1 callers
Method
completions
(self, body: CreateCompletionsDTO)
chatbi/domain/llm/service.py:11
↓ 1 callers
Method
connect
Connect to SQLite database with connection pooling and validation. Args: connection_info: Connection parameters
chatbi/database/drivers/sqlite_adapter.py:145
↓ 1 callers
Method
count
Count total number of datasources with optional filtering. Args: type_filter: Optional filter by datasource type
chatbi/domain/datasource/repository.py:72
↓ 1 callers
Method
create
Create new entity. Args: entity: Entity to create Returns: Created entity with ID populated
chatbi/domain/common/repository.py:239
↓ 1 callers
Function
createConfig
({ strict = true, dev = true } = {})
web/unocss.config.ts:3
↓ 1 callers
Function
createDatasource
* Create a new datasource * @param data - Datasource creation data * @returns Created datasource
web/src/services/datasource.ts:80
↓ 1 callers
Method
create_chat_session
Create a new chat session. Args: session_data: Dictionary containing session attributes Returns: Cr
chatbi/domain/chat/repository.py:74
↓ 1 callers
Method
create_collection_if_not_exists
Create collection if it doesn't exist
chatbi/database/qdrant.py:71
↓ 1 callers
Method
create_datasource
Create a new datasource with optimized connection validation. Args: db: Database session data: Datasource cr
chatbi/domain/datasource/service.py:59
↓ 1 callers
Method
create_model
Create a new MDL model
chatbi/domain/mdl/service.py:232
↓ 1 callers
Method
create_project
Create a new MDL project
chatbi/domain/mdl/service.py:93
↓ 1 callers
Method
create_user
创建用户(仅管理员)
chatbi/domain/auth/service.py:116
↓ 1 callers
Method
delete
Delete a value from the cache. Args: id: Unique identifier for the cached item Returns: bool: True
chatbi/cache/base.py:68
↓ 1 callers
Function
deleteDatasource
* Delete a datasource * @param id - Datasource ID * @returns Deletion status
web/src/services/datasource.ts:127
↓ 1 callers
Method
delete_collection
Delete a collection
chatbi/database/qdrant.py:140
↓ 1 callers
Method
delete_datasource
Delete a datasource with proper cleanup. Args: db: Database session datasource_id: ID of the datasource to d
chatbi/domain/datasource/service.py:248
↓ 1 callers
Method
delete_model
Delete an MDL model
chatbi/domain/mdl/service.py:315
↓ 1 callers
Method
delete_project
Delete an MDL project
chatbi/domain/mdl/service.py:154
↓ 1 callers
Method
delete_user
删除用户(仅管理员)
chatbi/domain/auth/service.py:166
↓ 1 callers
Function
drop_database
Drop the database if it exists.
chatbi/migrations/manage_migrations.py:105
↓ 1 callers
Function
event_generator
Generate SSE events
chatbi/domain/ask/router.py:78
↓ 1 callers
Function
executeQuery
* Execute a SQL query against a datasource * @param id - Datasource ID * @param query - SQL query string * @param timeout - Query timeout in
web/src/services/datasource.ts:177
↓ 1 callers
Method
execute_script
Execute a SQL script with multiple statements. Args: script: SQL script string with multiple statements Returns
chatbi/database/database.py:537
↓ 1 callers
Function
fetchData
()
web/src/pages/Home/index.tsx:33
↓ 1 callers
Function
fetchDatasource
()
web/src/pages/DataSource/Edit.tsx:16
← previous
next →
101–200 of 811, ranked by callers