Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aliyun/data-agent-skill
/ functions
Functions
258 in github.com/aliyun/data-agent-skill
⨍
Functions
258
◇
Types & classes
49
↓ 61 callers
Function
_out
Print text to console and record it as result output. Use for actual Data Agent results that should appear in output.md: conclusions, plans,
scripts/cli/streaming.py:173
↓ 16 callers
Method
_call_api
Make a generic API call. Args: action: API action name. version: API version. params: Request parameters
scripts/data_agent/client.py:409
↓ 14 callers
Function
_get_field
Get a field value trying multiple possible key names.
scripts/cli/cmd_agent.py:13
↓ 14 callers
Method
describe_session
Get the status of a session. Args: session_id: The session ID. agent_id: The agent ID (optional, but used to construc
scripts/data_agent/client.py:747
↓ 12 callers
Function
_get_field
Get a field value trying multiple possible key names (case-insensitive). Args: obj: The dictionary to search *names: Possible fie
scripts/cli/cmd_ls.py:35
↓ 12 callers
Method
from_env
Create configuration from environment variables. Args: dotenv_path: Optional path to .env file to load. Returns:
scripts/data_agent/config.py:92
↓ 11 callers
Method
_resolve_dms_unit
Resolve the DMSUnit for the current tenant. Resolution priority: 1. Explicit config/environment override (``DATA_AGENT_DMS_UNIT``).
scripts/data_agent/client.py:146
↓ 11 callers
Method
_run_in_executor
Run a synchronous function in an executor. Args: func: The function to run. *args: Positional arguments.
scripts/data_agent/client.py:1411
↓ 10 callers
Function
_log
Print text to console only (progress.log) without recording to output.md. Use for diagnostic / process information: user query echo, plan step
scripts/cli/streaming.py:207
↓ 9 callers
Function
_get_field
Get a field value trying multiple possible key names.
scripts/cli/cmd_workspace.py:14
↓ 9 callers
Method
update_last_used
Update the last used timestamp.
scripts/data_agent/models.py:52
↓ 8 callers
Method
is_running
Check if session is in an active/usable state (RUNNING, IDLE or WAIT_INPUT).
scripts/data_agent/models.py:48
↓ 7 callers
Function
_stream_response
Stream response tokens to stdout in real-time. Uses StreamState to track cross-event context (plan progress, output_conclusion accumulation,
scripts/cli/streaming.py:355
↓ 7 callers
Method
create_or_reuse
Create a new session or reuse an existing one. Args: session_id: Optional existing session ID to reuse. agent_id: Opt
scripts/data_agent/session.py:35
↓ 7 callers
Method
send_message
Send a message to the Data Agent. Args: agent_id: The agent ID. session_id: The session ID. message: The
scripts/data_agent/client.py:797
↓ 7 callers
Method
stream_chat_content
Stream chat content from Data Agent using SSE. Automatically reconnects from the last checkpoint on SSL/connection errors, enabling r
scripts/data_agent/sse_client.py:393
↓ 7 callers
Method
write_both
Write to both plain text and JSONL logs. Args: text: Text to write to the plain text log. data: Optional structured d
scripts/cli/log_handler.py:66
↓ 6 callers
Function
_redact_sensitive_values
Return a copy of ``value`` with credentials redacted for debug logs.
scripts/data_agent/client.py:63
↓ 5 callers
Method
__init__
( self, message: str, code: str, request_id: Optional[str] = None, htt
scripts/data_agent/exceptions.py:108
↓ 5 callers
Method
close
Close open log file handles.
scripts/cli/log_handler.py:76
↓ 5 callers
Function
close_structured_logging
Close the structured logging files.
scripts/cli/streaming.py:115
↓ 4 callers
Function
_consume_step_label
Return and clear the pending step label for use as conclusion header.
scripts/cli/streaming.py:431
↓ 4 callers
Function
_fmt_output_conclusion
Wrap analysis conclusion text with visual borders. If output_dir is provided, extracts inline base64 images from the text, saves them to outp
scripts/cli/formatters.py:387
↓ 4 callers
Function
_is_debug_api_enabled
Return whether verbose API debug logging is enabled.
scripts/data_agent/client.py:53
↓ 4 callers
Method
_resolve_workspace_id
Resolve workspace ID with priority: explicit > env > cache > API call. Args: explicit: Explicitly provided workspace ID (highest
scripts/data_agent/client.py:266
↓ 4 callers
Function
init_structured_logging
Initialize structured logging to progress.log and progress.jsonl. Args: output_dir: Directory where progress files should be created
scripts/cli/streaming.py:89
↓ 4 callers
Method
list_files
List files associated with a session. Args: session_id: The session ID. file_category: Optional filter, e.g. "WebRepo
scripts/data_agent/file_manager.py:177
↓ 3 callers
Function
_build_data_source
Build DataSource from command-line arguments.
scripts/cli/cmd_db.py:31
↓ 3 callers
Function
_db_attach
Attach to an existing session's SSE stream without sending a message. Streams all incoming events to stdout in real-time using the same forma
scripts/cli/cmd_db.py:48
↓ 3 callers
Function
_extract_json_objects
Extract all JSON objects/arrays from a mixed content string. Handles cases like: - Plain text before JSON: "some text {...}" - Multiple J
scripts/cli/formatters.py:218
↓ 3 callers
Function
_extract_list
Extract a list from an API response regardless of nesting style. Handles ``{Data: [...]}`` and ``{Data: {List/DataList/Content: [...]}}``. Al
scripts/cli/cmd_ls.py:13
↓ 3 callers
Function
_flush_tool_call_response
Parse accumulated tool_call_response and format output. jupyter_cell results only shown in detail mode.
scripts/cli/streaming.py:730
↓ 3 callers
Function
_fmt_ask_report_render
Format ask_report_render confirmation prompt.
scripts/cli/formatters.py:486
↓ 3 callers
Function
_fmt_jupyter_cell
Format a jupyter_cell data event into human-readable text. Decision logic: - Parse nb_file_outputs for real content - Skip cells whose on
scripts/cli/formatters.py:19
↓ 3 callers
Function
_none_if_blank
Normalize blank optional strings to None.
scripts/data_agent/config.py:18
↓ 3 callers
Method
prepare_request_params
Prepare request parameters with PascalCase keys. Args: params: Original request parameters api_action: API action nam
scripts/data_agent/api_adapter.py:85
↓ 3 callers
Function
run_worker_with_handler
Generic worker execution with common error handling and session management. Args: args: Command line arguments data_source: Optio
scripts/cli/streaming_utils.py:123
↓ 3 callers
Function
setup_async_worker
Setup and run async worker process. Args: args: Command line arguments session: Session object containing session_id and agent_id
scripts/cli/worker_utils.py:40
↓ 3 callers
Method
to_api_dict
Convert to API request format.
scripts/data_agent/models.py:127
↓ 2 callers
Method
_call_dms_enterprise_list_tag_meta_asset
Call dms-enterprise.ListTagMetaAsset via a short-lived OpenApiClient. Args: tag_name: The tag name to query assets for.
scripts/data_agent/client.py:294
↓ 2 callers
Function
_db_batch
Execute batch preset queries.
scripts/cli/cmd_db.py:201
↓ 2 callers
Function
_db_single
Execute a single query with streaming output.
scripts/cli/cmd_db.py:225
↓ 2 callers
Method
_event_to_content_block
Convert SSE event to ContentBlock. Args: event: SSE event to convert. Returns: ContentBlock or None if not a
scripts/data_agent/message.py:239
↓ 2 callers
Method
_event_to_content_block
Convert SSE event to ContentBlock.
scripts/data_agent/message.py:442
↓ 2 callers
Function
_finalize_stream
Flush any pending accumulators when the stream ends.
scripts/cli/streaming.py:413
↓ 2 callers
Function
_fmt_insights
Format a list of insight objects (final conclusion).
scripts/cli/formatters.py:190
↓ 2 callers
Function
_format_parsed_json
Format a parsed JSON value (dict or list) for display.
scripts/cli/formatters.py:291
↓ 2 callers
Function
_format_timestamp
Format a unix timestamp (seconds) to readable date string.
scripts/cli/cmd_workspace.py:22
↓ 2 callers
Function
_handle_ask_plan
Format ask_plan confirmation prompt.
scripts/cli/streaming.py:930
↓ 2 callers
Function
_handle_data_plan
Handle data/plan events — show step progress. detail mode: full "[Plan] Step n/N: name" with description. summary mode: compact progress dot
scripts/cli/streaming.py:596
↓ 2 callers
Method
_parse_event
Parse an SSE event. Args: event_type: The event type. data_str: The data JSON string. Returns: P
scripts/data_agent/sse_client.py:445
↓ 2 callers
Method
_parse_event
Parse an SSE event.
scripts/data_agent/sse_client.py:767
↓ 2 callers
Function
_print_event
Route a single SSE event to the appropriate output handler. Args: event: The SSE event to handle. output_mode: "summary" (minimal
scripts/cli/streaming.py:302
↓ 2 callers
Function
_print_generated_files
Print list of files generated by the Agent.
scripts/cli/cmd_file.py:342
↓ 2 callers
Function
_row_str
(vals: list)
scripts/cli/formatters.py:167
↓ 2 callers
Method
_sha256_hex
Calculate SHA256 hash and return hex string.
scripts/data_agent/sse_client.py:46
↓ 2 callers
Function
_stream_response_with_data_source
Wrapper for _stream_response that handles data_source parameter properly.
scripts/cli/streaming_utils.py:68
↓ 2 callers
Function
convert_keys_to_pascal
Recursively convert all dictionary keys to PascalCase. Args: obj: Input object (dict, list, or primitive) exclude_paths: List of
scripts/data_agent/api_adapter.py:25
↓ 2 callers
Method
create_session
Create a new Data Agent session. Args: database_id: Optional database ID to bind to the session. title: Session title
scripts/data_agent/client.py:643
↓ 2 callers
Method
download_from_url
Download a file from a URL and save locally. Args: download_url: Direct download URL. save_path: Local path to save t
scripts/data_agent/file_manager.py:215
↓ 2 callers
Method
file_upload_callback
Notify the service that file upload is complete. Args: file_id: The file ID from upload signature (uploadDir). filena
scripts/data_agent/client.py:924
↓ 2 callers
Method
get_file_upload_signature
Get OSS upload signature for file upload. Args: filename: Name of the file to upload. file_size: Size of the file in
scripts/data_agent/client.py:898
↓ 2 callers
Method
get_full_response
Get complete response by collecting all SSE events. Collects all `data` events (excluding tool_call_choices and metric_agent_config),
scripts/data_agent/sse_client.py:472
↓ 2 callers
Function
handle_worker_completion
Handle worker process completion by updating status files. Args: session_dir: Session directory path need_confirm: Whether user c
scripts/cli/worker_utils.py:111
↓ 2 callers
Method
is_supported_file
Check if a file type is supported. Args: file_path: Path to the file. Returns: True if file type is supporte
scripts/data_agent/file_manager.py:319
↓ 2 callers
Function
is_worker_process
Check if this is a worker process.
scripts/cli/worker_utils.py:19
↓ 2 callers
Method
list_databases
List databases in workspace via ListTagMetaAsset. Falls back to list_file_databases in API_KEY mode. Args: workspace_id:
scripts/data_agent/client.py:1014
↓ 2 callers
Method
list_files
List files associated with a session. Args: session_id: The session ID. file_category: Optional filter, e.g. "WebRepo
scripts/data_agent/client.py:961
↓ 2 callers
Method
prepare_request_body
Prepare request body with PascalCase keys. Args: body: Original request body Returns: Body with PascalCase k
scripts/data_agent/api_adapter.py:104
↓ 2 callers
Method
process_response
Process API response to convert keys to camelCase. Args: response: Original API response api_action: API action name
scripts/data_agent/api_adapter.py:116
↓ 2 callers
Method
sign
Generate signed headers for Alibaba Cloud API V3. Args: access_key_id: Access Key ID. access_key_secret: Access Key S
scripts/data_agent/sse_client.py:56
↓ 2 callers
Method
upload_file
Upload a file for analysis. Args: file_path: Path to the local file. timeout: Upload timeout in seconds. Ret
scripts/data_agent/file_manager.py:59
↓ 2 callers
Method
wait_until_running
Wait for session to reach RUNNING state. Args: session_id: The session ID. agent_id: The agent ID (optional).
scripts/data_agent/session.py:123
↓ 2 callers
Function
write_to_jsonl
Write structured data to JSONL file. Args: data: Dictionary containing structured log data
scripts/cli/streaming.py:132
↓ 2 callers
Function
write_to_progress_log
Write text to progress log file. Args: text: Text to write to the plain text log
scripts/cli/streaming.py:149
↓ 1 callers
Method
_async_do_stream
Single-connection async streaming attempt.
scripts/data_agent/sse_client.py:524
↓ 1 callers
Method
_async_do_stream_with_ak_sk
Async stream with AK/SK authentication via default credential chain.
scripts/data_agent/sse_client.py:622
↓ 1 callers
Method
_async_do_stream_with_api_key
Async stream with API_KEY authentication.
scripts/data_agent/sse_client.py:542
↓ 1 callers
Function
_build_client
Build an OpenApiClient for dms-enterprise using the default credential chain.
scripts/verify_active_route_unit.py:63
↓ 1 callers
Function
_call
Invoke GetActiveRouteUnit with the given params. Returns the response body dict.
scripts/verify_active_route_unit.py:74
↓ 1 callers
Method
_call_api_with_ak_sk
Make an API call using AK/SK authentication.
scripts/data_agent/client.py:559
↓ 1 callers
Method
_call_api_with_api_key
Make an API call using API_KEY authentication.
scripts/data_agent/client.py:440
↓ 1 callers
Method
_call_dms_enterprise_route_unit
Call dms-enterprise.GetActiveRouteUnit via a short-lived OpenApiClient. The dms-enterprise endpoint differs from the Data Agent endpoint, so
scripts/data_agent/client.py:201
↓ 1 callers
Method
_call_init_personal_workspace
Call InitDataAgentPersonalWorkspace to get the user's personal workspace ID. Returns: The workspace ID string. Raises:
scripts/data_agent/client.py:234
↓ 1 callers
Function
_cmd_describe
Describe a custom agent in detail.
scripts/cli/cmd_agent.py:92
↓ 1 callers
Function
_cmd_list
List custom agents.
scripts/cli/cmd_agent.py:21
↓ 1 callers
Function
_confirm_import
Confirm the high-risk import operation before calling the API.
scripts/cli/cmd_import.py:13
↓ 1 callers
Function
_debug_enabled
()
scripts/verify_active_route_unit.py:59
↓ 1 callers
Function
_dispatch_event
Main dispatcher: routes by event_type to specialised handlers.
scripts/cli/streaming.py:458
↓ 1 callers
Method
_do_stream
Single-connection streaming attempt.
scripts/data_agent/sse_client.py:183
↓ 1 callers
Method
_do_stream_with_ak_sk
Stream with AK/SK authentication via default credential chain.
scripts/data_agent/sse_client.py:290
↓ 1 callers
Method
_do_stream_with_api_key
Stream with API_KEY authentication.
scripts/data_agent/sse_client.py:199
↓ 1 callers
Function
_extract_and_save_images
Extract inline base64 images from text and save to disk. Returns cleaned text with images replaced by file-path references.
scripts/cli/formatters.py:412
↓ 1 callers
Function
_extract_unit
Search for Route.RegionId in the response body. Per OpenAPI spec, the Route object (backend: "data") may contain {Uid, RegionId, Status}. Onl
scripts/verify_active_route_unit.py:98
↓ 1 callers
Method
_file_exists_in_session
(self, file_id: str, session_id: Optional[str])
scripts/data_agent/file_manager.py:54
↓ 1 callers
Method
_file_exists_in_session
(self, file_id: str, session_id: Optional[str])
scripts/data_agent/file_manager.py:353
↓ 1 callers
Function
_fmt_plan_progress
Format a plan data event showing step progress. Expected plan_data structure (from API): {"current_step": 2, "plan_status": "...", "plans":
scripts/cli/formatters.py:335
↓ 1 callers
Function
_fmt_recommended_questions
Format recommended follow-up questions. Expected JSON: {"questions": ["q1", "q2", ...]} or a list of strings.
scripts/cli/formatters.py:458
↓ 1 callers
Function
_fmt_status_change
Format a status_change event's JSON content. Expected JSON: {"previous": "PLANNING", "current": "STEP_EXECUTION", "current_task": "..."}
scripts/cli/formatters.py:367
↓ 1 callers
Function
_fmt_table_summaries
Format table summary list for display.
scripts/cli/formatters.py:312
next →
1–100 of 258, ranked by callers