Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bytedance/trae-agent
/ functions
Functions
548 in github.com/bytedance/trae-agent
⨍
Functions
548
◇
Types & classes
111
↳
Endpoints
26
↓ 44 callers
Method
print
Print a message to the console.
trae_agent/utils/cli/cli_console.py:91
↓ 33 callers
Method
execute
Execute the tool with given parameters.
trae_agent/tools/base.py:116
↓ 17 callers
Method
replace
(self, **kwargs)
evaluation/patch_selection/trae_selector/tools/tools/base.py:29
↓ 13 callers
Method
print
Print a message to the console.
trae_agent/utils/cli/simple_console.py:183
↓ 12 callers
Method
run
( self, task: str, extra_args: dict[str, str] | None = None, tool_names: list[
trae_agent/agent/agent.py:59
↓ 12 callers
Method
start
(self)
trae_agent/tools/bash_tool.py:35
↓ 11 callers
Method
_insert_entry
Insert entry into db. Args: entry: the entry to insert Returns: None
trae_agent/tools/ckg/ckg_database.py:576
↓ 11 callers
Method
update
Update the CKG database.
trae_agent/tools/ckg/ckg_database.py:201
↓ 10 callers
Method
create_from_legacy_config
( cls, *, legacy_config: LegacyConfig | None = None, config_file: str | None =
trae_agent/utils/config.py:325
↓ 7 callers
Method
_update_cli_console
( self, step: AgentStep | None = None, agent_execution: AgentExecution | None = None )
trae_agent/agent/base_agent.py:285
↓ 7 callers
Method
create
( cls, *, config_file: str | None = None, config_string: str | None = None,
trae_agent/utils/config.py:206
↓ 7 callers
Method
get_name
Get the tool name.
trae_agent/tools/base.py:101
↓ 7 callers
Method
mock_file_read
Helper to mock file reading operations.
tests/tools/test_json_edit_tool.py:26
↓ 7 callers
Method
run
(self)
evaluation/patch_selection/trae_selector/selector_agent.py:190
↓ 6 callers
Method
chat
Send chat messages to the LLM.
trae_agent/utils/llm_clients/llm_client.py:72
↓ 6 callers
Method
get_input_schema
Get the input schema for the tool.
trae_agent/tools/base.py:127
↓ 6 callers
Method
mock_file_system
Helper to mock file system operations
tests/tools/test_edit_tool.py:19
↓ 6 callers
Method
record_llm_interaction
Record an LLM interaction. Args: messages: Input messages to the LLM response: Response from the LLM prov
trae_agent/utils/trajectory_recorder.py:77
↓ 6 callers
Method
run
Execute a command in the bash shell.
trae_agent/tools/bash_tool.py:87
↓ 6 callers
Method
supports_tool_calling
Check if the current client supports tool calling.
trae_agent/utils/llm_clients/llm_client.py:82
↓ 6 callers
Method
update_mcp_server_status
(self, mcp_server_name, status: MCPServerStatus)
trae_agent/utils/mcp_client.py:36
↓ 5 callers
Method
get_description
Get the tool description.
trae_agent/tools/base.py:106
↓ 5 callers
Method
get_mcp_server_status
(self, mcp_server_name: str)
trae_agent/utils/mcp_client.py:33
↓ 5 callers
Function
retry_with
Decorator that adds retry logic with randomized backoff. Args: func: The function to decorate provider_name: The name of the
trae_agent/utils/llm_clients/retry_utils.py:13
↓ 5 callers
Method
save_trajectory
Save the current trajectory data to file.
trae_agent/utils/trajectory_recorder.py:220
↓ 5 callers
Method
stop
(self)
evaluation/patch_selection/trae_selector/tools/tools/bash.py:37
↓ 4 callers
Method
_load_json_file
Load and parse JSON file.
trae_agent/tools/json_edit_tool.py:157
↓ 4 callers
Method
_load_json_file
(self, file_path: Path)
trae_agent/tools/json_edit_tool_cli.py:75
↓ 4 callers
Method
_make_output
( self, file_content: str, file_descriptor: str, init_line: int = 1, e
evaluation/patch_selection/trae_selector/tools/tools/edit.py:229
↓ 4 callers
Method
_parse_jsonpath
Parse JSONPath expression with error handling.
trae_agent/tools/json_edit_tool.py:186
↓ 4 callers
Method
_parse_jsonpath
(self, json_path_str: str)
trae_agent/tools/json_edit_tool_cli.py:101
↓ 4 callers
Method
_serialize_tool_call
Serialize a tool call to a dictionary.
trae_agent/utils/trajectory_recorder.py:244
↓ 4 callers
Method
cleanup
Clean up resources
trae_agent/utils/mcp_client.py:101
↓ 4 callers
Method
execute
(self, command, timeout=60)
evaluation/patch_selection/trae_selector/sandbox.py:61
↓ 4 callers
Method
get_base_config
(self)
tests/utils/test_config.py:143
↓ 4 callers
Method
new_task
Create a new task.
trae_agent/agent/trae_agent.py:103
↓ 4 callers
Method
parse_tool_call_result
Parse a ToolResult into a Gemini FunctionResponse Part for history.
trae_agent/utils/llm_clients/google_client.py:203
↓ 4 callers
Function
resolve_config_value
Resolve configuration value with priority: CLI > ENV > Config > Default.
trae_agent/utils/config.py:394
↓ 4 callers
Method
resolve_config_values
( self, *, provider: str | None = None, model: str | None = None, mode
trae_agent/utils/config.py:302
↓ 4 callers
Method
stop
Terminate the bash shell.
trae_agent/tools/bash_tool.py:63
↓ 4 callers
Method
write_file
(self, path: Path, file: str)
evaluation/patch_selection/trae_selector/tools/tools/edit.py:223
↓ 3 callers
Method
_image_name
Get the Docker image name for a given instance ID. Args: instance_id: Instance identifier. Returns:
evaluation/run_evaluation.py:94
↓ 3 callers
Method
_make_output
Generate output for the CLI based on the content of a file.
trae_agent/tools/edit_tool_cli.py:336
↓ 3 callers
Method
_make_output
Generate output for the CLI based on the content of a file.
trae_agent/tools/edit_tool.py:292
↓ 3 callers
Method
_save_json_file
Save JSON data to file.
trae_agent/tools/json_edit_tool.py:173
↓ 3 callers
Method
_save_json_file
( self, file_path: Path, data: dict | list, pretty_print: bool = True )
trae_agent/tools/json_edit_tool_cli.py:89
↓ 3 callers
Method
close
(self)
evaluation/patch_selection/trae_selector/sandbox.py:106
↓ 3 callers
Method
close
Ensure proper tool resource deallocation before task completion.
trae_agent/tools/base.py:177
↓ 3 callers
Method
connect_and_discover
( self, mcp_server_name: str, mcp_server_config: MCPServerConfig, mcp_tools_co
trae_agent/utils/mcp_client.py:39
↓ 3 callers
Function
docker_exec
Execute a shell command inside a Docker container. Args: container: Docker container object. command: Shell command to execu
evaluation/utils.py:15
↓ 3 callers
Function
get_ckg_database_path
Get the path to the CKG database for a codebase path.
trae_agent/tools/ckg/ckg_database.py:31
↓ 3 callers
Method
get_git_diff
Get the git diff of the project.
trae_agent/agent/trae_agent.py:180
↓ 3 callers
Method
get_name
(self)
trae_agent/tools/ckg_tool.py:34
↓ 3 callers
Method
get_name
(self)
trae_agent/tools/edit_tool_cli.py:82
↓ 3 callers
Method
get_parameters
Get the tool parameters.
trae_agent/tools/base.py:111
↓ 3 callers
Method
insert
(self, path: Path, insert_line: int, new_str: str)
evaluation/patch_selection/trae_selector/tools/tools/edit.py:170
↓ 3 callers
Function
maybe_truncate
(content: str, truncate_after: int | None = MAX_RESPONSE_LEN)
evaluation/patch_selection/trae_selector/tools/tools/run.py:8
↓ 3 callers
Function
maybe_truncate
Truncate content and append a notice if content exceeds the specified length.
trae_agent/tools/run.py:21
↓ 3 callers
Method
parse_messages
Parse the messages to Gemini format, separating system instructions.
trae_agent/utils/llm_clients/google_client.py:171
↓ 3 callers
Method
read_file
(self, path: Path)
evaluation/patch_selection/trae_selector/tools/tools/edit.py:217
↓ 3 callers
Method
read_file
Read the content of a file from a given path; raise a ToolError if an error occurs.
trae_agent/tools/edit_tool_cli.py:322
↓ 3 callers
Method
read_file
Read the content of a file from a given path; raise a ToolError if an error occurs.
trae_agent/tools/edit_tool.py:278
↓ 3 callers
Function
resolve_config_file
Resolve config file with backward compatibility. First tries the specified file, then falls back to JSON if YAML doesn't exist.
trae_agent/cli.py:31
↓ 3 callers
Method
run
(self, command: str)
evaluation/patch_selection/trae_selector/tools/tools/bash.py:44
↓ 3 callers
Function
save_selection_success
( instance_id: str, statistics_path: str, patch_id: int, is_success: int, group_id=1,
evaluation/patch_selection/trae_selector/utils.py:116
↓ 3 callers
Method
set_lakeview
Set the lakeview configuration for the console.
trae_agent/utils/cli/cli_console.py:118
↓ 3 callers
Method
write_file
Write the content of a file to a given path; raise a ToolError if an error occurs.
trae_agent/tools/edit_tool_cli.py:329
↓ 3 callers
Method
write_file
Write the content of a file to a given path; raise a ToolError if an error occurs.
trae_agent/tools/edit_tool.py:285
↓ 2 callers
Method
_construct_ckg
Initialise the code knowledge graph.
trae_agent/tools/ckg/ckg_database.py:534
↓ 2 callers
Method
_create_handler
(self, arguments: ToolCallArguments, _path: Path)
trae_agent/tools/edit_tool_cli.py:366
↓ 2 callers
Method
_finalize_step
( self, step: "AgentStep", messages: list["LLMMessage"], execution: "AgentExecution" )
trae_agent/agent/base_agent.py:238
↓ 2 callers
Method
_id_generator
Generate a random ID string
trae_agent/utils/llm_clients/ollama_client.py:194
↓ 2 callers
Method
_insert_handler
(self, arguments: ToolCallArguments, _path: Path)
trae_agent/tools/edit_tool_cli.py:391
↓ 2 callers
Method
_is_task_completed
Enhanced task completion detection.
trae_agent/agent/trae_agent.py:236
↓ 2 callers
Method
_normalize_name
Normalize tool name by making it lowercase and removing underscores.
trae_agent/tools/base.py:195
↓ 2 callers
Method
_serialize_message
Serialize an LLM message to a dictionary.
trae_agent/utils/trajectory_recorder.py:232
↓ 2 callers
Method
_serialize_tool_result
Serialize a tool result to a dictionary.
trae_agent/utils/trajectory_recorder.py:253
↓ 2 callers
Method
_start_persistent_shell
Spawns a persistent bash shell inside the container using pexpect.
trae_agent/agent/docker_manager.py:181
↓ 2 callers
Method
_str_replace_handler
(self, arguments: ToolCallArguments, _path: Path)
trae_agent/tools/edit_tool_cli.py:376
↓ 2 callers
Method
_view
Implement the view command
trae_agent/tools/edit_tool_cli.py:198
↓ 2 callers
Method
_view
Implement the view command
trae_agent/tools/edit_tool.py:154
↓ 2 callers
Method
_view_handler
(self, arguments: ToolCallArguments, _path: Path)
trae_agent/tools/edit_tool_cli.py:354
↓ 2 callers
Function
_write_problem_statement
Helper function to write problem statement using context manager.
evaluation/utils.py:65
↓ 2 callers
Function
analyze_group
(statistics_folder_path, total_num_instances=500)
evaluation/patch_selection/analysis.py:110
↓ 2 callers
Method
call_tool
(self, name, args)
trae_agent/utils/mcp_client.py:93
↓ 2 callers
Method
chat
Send chat messages to Gemini with optional tool support.
trae_agent/utils/llm_clients/google_client.py:50
↓ 2 callers
Method
connect_to_server
Connect to an MCP server Args: server_params: Parameters for connecting to the MCP server.
trae_agent/utils/mcp_client.py:74
↓ 2 callers
Method
create_console
Create a console instance based on type and mode. Args: console_type: Type of console to create (SIMPLE or RICH) mode
trae_agent/utils/cli/console_factory.py:17
↓ 2 callers
Method
execute_tool_call
Execute a tool call.
trae_agent/tools/base.py:205
↓ 2 callers
Method
finalize_recording
Finalize the trajectory recording. Args: success: Whether the task completed successfully final_result: Final result
trae_agent/utils/trajectory_recorder.py:198
↓ 2 callers
Function
generate_agent_step_table
Log an agent step to the console.
trae_agent/utils/cli/cli_console.py:126
↓ 2 callers
Function
get_file_metadata_hash
Get hash based on file metadata (name, mtime, size) for non-git repositories.
trae_agent/tools/ckg/ckg_database.py:83
↓ 2 callers
Method
get_max_tokens_param
Get the maximum tokens parameter value.Prioritizes max_completion_tokens, falls back to max_tokens if not available.
trae_agent/utils/config.py:48
↓ 2 callers
Method
get_model_provider
Get the model provider.
trae_agent/tools/base.py:96
↓ 2 callers
Method
get_name
(self)
trae_agent/tools/edit_tool.py:38
↓ 2 callers
Method
get_recommended_console_type
Get the recommended console type for a given mode. Args: mode: Console operation mode Returns: Recommended c
trae_agent/utils/cli/console_factory.py:42
↓ 2 callers
Method
get_session
(self)
evaluation/patch_selection/trae_selector/sandbox.py:54
↓ 2 callers
Function
get_trajectory_filename
(instance_id, traj_dir, group_id=1, voting_id=1)
evaluation/patch_selection/trae_selector/utils.py:99
↓ 2 callers
Function
get_unique_filename
(patches_path, trial_index)
evaluation/patch_selection/trae_selector/utils.py:83
↓ 2 callers
Method
list_tools
(self)
trae_agent/utils/mcp_client.py:97
next →
1–100 of 548, ranked by callers