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
↓ 2 callers
Method
parse_messages
Parse the messages to Anthropic format.
trae_agent/utils/llm_clients/anthropic_client.py:155
↓ 2 callers
Method
parse_messages
Parse LLM messages to OpenAI format.
trae_agent/utils/llm_clients/openai_compatible_base.py:217
↓ 2 callers
Method
parse_messages
Parse the messages to OpenAI format.
trae_agent/utils/llm_clients/openai_client.py:166
↓ 2 callers
Method
parse_messages
Ollama parse messages should be compatible with openai handling
trae_agent/utils/llm_clients/ollama_client.py:146
↓ 2 callers
Method
query_function
Search for a function in the database. Args: identifier: the identifier of the function to search for Returns:
trae_agent/tools/ckg/ckg_database.py:648
↓ 2 callers
Function
remove_comments_from_line
(line: str)
evaluation/patch_selection/trae_selector/utils.py:11
↓ 2 callers
Method
remove_patches_to_tests
Remove any changes to the tests directory from the provided patch. This is to ensure that the model_patch does not disturb the repo's
trae_agent/agent/trae_agent.py:205
↓ 2 callers
Function
save_patches
(instance_id, patches_path, patches, group_id=1)
evaluation/patch_selection/trae_selector/utils.py:77
↓ 2 callers
Method
set_agent_context
Set the agent context for task execution in interactive mode.
trae_agent/utils/cli/rich_console.py:358
↓ 2 callers
Method
set_cli_console
Set the CLI console for this agent.
trae_agent/agent/base_agent.py:103
↓ 2 callers
Method
start
(self)
evaluation/patch_selection/trae_selector/tools/tools/bash.py:21
↓ 2 callers
Method
start
Starts/attaches to the container, mounts the workspace, copies tools, and starts the shell.
trae_agent/agent/docker_manager.py:45
↓ 2 callers
Method
stop_container
(self)
evaluation/patch_selection/trae_selector/sandbox.py:115
↓ 2 callers
Method
validate_path
Validate the path for the str_replace_editor tool.
trae_agent/tools/edit_tool_cli.py:178
↓ 1 callers
Method
__init__
(self, model_provider: str | None = None)
trae_agent/tools/base.py:77
↓ 1 callers
Method
__init__
(self, model_provider: str | None = None)
trae_agent/tools/edit_tool_cli.py:15
↓ 1 callers
Method
__init__
(self, model_provider: str | None = None)
trae_agent/tools/json_edit_tool_cli.py:20
↓ 1 callers
Method
__init__
(self, console_impl: "RichCLIConsole")
trae_agent/utils/cli/rich_console.py:67
↓ 1 callers
Method
_add_json_value
Add value at specified JSONPath.
trae_agent/tools/json_edit_tool.py:247
↓ 1 callers
Method
_add_json_value
( self, file_path: Path, json_path_str: str, value, pretty_print: bool )
trae_agent/tools/json_edit_tool_cli.py:143
↓ 1 callers
Method
_agent_step_str
(self, agent_step: AgentStep)
trae_agent/utils/lake_view.py:177
↓ 1 callers
Method
_check_images
Check existence of required Docker images for all instances. Updates self.image_status dict.
evaluation/run_evaluation.py:106
↓ 1 callers
Method
_close_tools
Release tool resources, mainly about BashTool object.
trae_agent/agent/base_agent.py:202
↓ 1 callers
Method
_copy_tools_to_container
Copies the local tools directory to a fixed path inside the container.
trae_agent/agent/docker_manager.py:162
↓ 1 callers
Method
_create_handler
(self, arguments: ToolCallArguments, _path: Path)
trae_agent/tools/edit_tool.py:322
↓ 1 callers
Method
_create_lakeview_step_display
Create lakeview display for a step.
trae_agent/utils/cli/simple_console.py:222
↓ 1 callers
Method
_execute_in_docker
Builds and executes a command inside the Docker container, with path translation.
trae_agent/tools/docker_tool_executor.py:77
↓ 1 callers
Method
_execute_interactive
Executes a command within the existing persistent shell.
trae_agent/agent/docker_manager.py:204
↓ 1 callers
Method
_execute_task
Execute a task using the agent.
trae_agent/utils/cli/rich_console.py:157
↓ 1 callers
Method
_insert
Implement the insert command, which inserts new_str at the specified line in the file content.
trae_agent/tools/edit_tool_cli.py:282
↓ 1 callers
Method
_insert
Implement the insert command, which inserts new_str at the specified line in the file content.
trae_agent/tools/edit_tool.py:238
↓ 1 callers
Method
_insert_class
Insert class entry into db. Args: entry: the entry to insert Returns: None
trae_agent/tools/ckg/ckg_database.py:622
↓ 1 callers
Method
_insert_function
Insert function entry including functions and class methodsinto db. Args: entry: the entry to insert Returns:
trae_agent/tools/ckg/ckg_database.py:596
↓ 1 callers
Method
_insert_handler
(self, arguments: ToolCallArguments, _path: Path)
trae_agent/tools/edit_tool.py:347
↓ 1 callers
Method
_is_task_completed
Check if the task is completed based on the response. Override for custom logic.
trae_agent/agent/base_agent.py:272
↓ 1 callers
Function
_load_jsonl_dataset
Helper function to load JSONL dataset using context manager.
evaluation/utils.py:71
↓ 1 callers
Function
_msg_role_handler
(messages: list[ChatCompletionMessageParam], msg: LLMMessage)
trae_agent/utils/llm_clients/openai_compatible_base.py:266
↓ 1 callers
Function
_msg_tool_call_handler
(messages: list[ChatCompletionMessageParam], msg: LLMMessage)
trae_agent/utils/llm_clients/openai_compatible_base.py:232
↓ 1 callers
Function
_msg_tool_result_handler
(messages: list[ChatCompletionMessageParam], msg: LLMMessage)
trae_agent/utils/llm_clients/openai_compatible_base.py:248
↓ 1 callers
Method
_print_execution_summary
Print the final execution summary.
trae_agent/utils/cli/simple_console.py:122
↓ 1 callers
Method
_print_lakeview_summary
Print lakeview summary of all completed steps.
trae_agent/utils/cli/simple_console.py:110
↓ 1 callers
Method
_print_step_update
Print a step update as it progresses.
trae_agent/utils/cli/simple_console.py:89
↓ 1 callers
Method
_record_handler
(self, step: AgentStep, messages: list[LLMMessage])
trae_agent/agent/base_agent.py:301
↓ 1 callers
Method
_recursive_visit_c
Recursively visit the C AST and insert the entries into the database.
trae_agent/tools/ckg/ckg_database.py:399
↓ 1 callers
Method
_recursive_visit_cpp
Recursively visit the C++ AST and insert the entries into the database.
trae_agent/tools/ckg/ckg_database.py:334
↓ 1 callers
Method
_recursive_visit_java
Recursively visit the Java AST and insert the entries into the database.
trae_agent/tools/ckg/ckg_database.py:279
↓ 1 callers
Method
_recursive_visit_javascript
Recursively visit the JavaScript AST and insert the entries into the database.
trae_agent/tools/ckg/ckg_database.py:479
↓ 1 callers
Method
_recursive_visit_python
Recursively visit the Python AST and insert the entries into the database.
trae_agent/tools/ckg/ckg_database.py:205
↓ 1 callers
Method
_recursive_visit_typescript
( self, root_node: Node, file_path: str, parent_class: ClassEntry | None = Non
trae_agent/tools/ckg/ckg_database.py:425
↓ 1 callers
Method
_remove_json_value
Remove value at specified JSONPath.
trae_agent/tools/json_edit_tool.py:288
↓ 1 callers
Method
_remove_json_value
( self, file_path: Path, json_path_str: str, pretty_print: bool )
trae_agent/tools/json_edit_tool_cli.py:174
↓ 1 callers
Method
_run_llm_step
( self, step: "AgentStep", messages: list["LLMMessage"], execution: "AgentExecution" )
trae_agent/agent/base_agent.py:209
↓ 1 callers
Function
_run_rich_interactive_loop
Run the interactive loop for rich console.
trae_agent/cli.py:598
↓ 1 callers
Function
_run_simple_interactive_loop
Run the interactive loop for simple console.
trae_agent/cli.py:516
↓ 1 callers
Method
_search_class
Search for a class in the ckg database.
trae_agent/tools/ckg_tool.py:164
↓ 1 callers
Method
_search_class_method
Search for a class method in the ckg database.
trae_agent/tools/ckg_tool.py:197
↓ 1 callers
Method
_search_function
Search for a function in the ckg database.
trae_agent/tools/ckg_tool.py:135
↓ 1 callers
Method
_set_json_value
Set value at specified JSONPath.
trae_agent/tools/json_edit_tool.py:226
↓ 1 callers
Method
_set_json_value
( self, file_path: Path, json_path_str: str, value, pretty_print: bool )
trae_agent/tools/json_edit_tool_cli.py:127
↓ 1 callers
Method
_str_replace_handler
(self, arguments: ToolCallArguments, _path: Path)
trae_agent/tools/edit_tool.py:332
↓ 1 callers
Method
_tool_call_handler
( self, tool_calls: list[ToolCall] | None, step: AgentStep )
trae_agent/agent/base_agent.py:314
↓ 1 callers
Method
_translate_path
Robust path translation function: Translate the host path into the corresponding path within the container.
trae_agent/tools/docker_tool_executor.py:35
↓ 1 callers
Method
_update_llm_usage
(self, llm_response: LLMResponse, execution: AgentExecution)
trae_agent/agent/base_agent.py:291
↓ 1 callers
Method
_validate_thought_data
Validate the input arguments and return a ThoughtData object.
trae_agent/tools/sequential_thinking_tool.py:163
↓ 1 callers
Method
_view_handler
(self, arguments: ToolCallArguments, _path: Path)
trae_agent/tools/edit_tool.py:310
↓ 1 callers
Method
_view_json
View JSON file content or specific paths.
trae_agent/tools/json_edit_tool.py:195
↓ 1 callers
Method
_view_json
( self, file_path: Path, json_path_str: str | None, pretty_print: bool )
trae_agent/tools/json_edit_tool_cli.py:109
↓ 1 callers
Function
_write_multi_problem_statement
Helper function to write multi-issue problem statement using context manager.
evaluation/utils.py:81
↓ 1 callers
Function
amain
()
trae_agent/tools/json_edit_tool_cli.py:207
↓ 1 callers
Function
build_system_prompt
(candidate_length: int)
evaluation/patch_selection/trae_selector/selector_agent.py:23
↓ 1 callers
Function
build_with_pyinstaller
()
trae_agent/cli.py:89
↓ 1 callers
Method
chat
A rewritten version of ollama chan
trae_agent/utils/llm_clients/ollama_client.py:72
↓ 1 callers
Function
check_docker
(timeout=3)
trae_agent/cli.py:53
↓ 1 callers
Function
clean_patch
(ori_patch_text)
evaluation/patch_selection/trae_selector/utils.py:33
↓ 1 callers
Method
cleanup_mcp_clients
Clean up all MCP clients to prevent async context leaks.
trae_agent/agent/trae_agent.py:252
↓ 1 callers
Method
cleanup_mcp_clients
Clean up MCP clients. Override in subclasses that use MCP.
trae_agent/agent/base_agent.py:281
↓ 1 callers
Function
clear_older_ckg
Iterate over all the files in the CKG storage directory and delete the ones that are older than 1 week.
trae_agent/tools/ckg/ckg_database.py:107
↓ 1 callers
Function
cli
Trae Agent - LLM-based agent for software engineering tasks.
trae_agent/cli.py:121
↓ 1 callers
Method
close_tools
Ensure all tool resources are properly released.
trae_agent/tools/base.py:189
↓ 1 callers
Method
create_client
Create the OpenAI client instance.
trae_agent/utils/llm_clients/openai_compatible_base.py:38
↓ 1 callers
Method
create_lakeview_step
(self, agent_step: AgentStep)
trae_agent/utils/lake_view.py:194
↓ 1 callers
Method
discover_mcp_tools
(self)
trae_agent/agent/trae_agent.py:72
↓ 1 callers
Function
execute_command
(**kwargs)
evaluation/patch_selection/trae_selector/tools/tools/execute_str_replace_editor.py:13
↓ 1 callers
Function
execute_command
(**kwargs)
evaluation/patch_selection/trae_selector/tools/tools/execute_bash.py:8
↓ 1 callers
Method
execute_task
Execute the task and finalize trajectory recording.
trae_agent/agent/trae_agent.py:156
↓ 1 callers
Method
extract_tag_in_step
(self, step: str)
trae_agent/utils/lake_view.py:138
↓ 1 callers
Method
extract_task_in_step
(self, prev_step: str, this_step: str)
trae_agent/utils/lake_view.py:94
↓ 1 callers
Method
get_all_preds
Collect all generated patches and write predictions.json to results directory. Args: instance_ids: List of instance IDs
evaluation/run_evaluation.py:352
↓ 1 callers
Method
get_config_with_mcp_servers
(self)
tests/utils/test_config.py:168
↓ 1 callers
Method
get_extra_headers
Get any extra headers needed for the API call.
trae_agent/utils/llm_clients/openai_compatible_base.py:55
↓ 1 callers
Function
get_folder_snapshot_hash
Get the hash of the folder snapshot, to make sure that the CKG is up to date.
trae_agent/tools/ckg/ckg_database.py:97
↓ 1 callers
Function
get_git_status_hash
Get hash for git repository (clean or dirty).
trae_agent/tools/ckg/ckg_database.py:51
↓ 1 callers
Method
get_label
(self, tags: None | list[str], emoji: bool = True)
trae_agent/utils/lake_view.py:88
↓ 1 callers
Method
get_name
(self)
trae_agent/tools/mcp_tool.py:19
↓ 1 callers
Method
get_name
(self)
trae_agent/tools/bash_tool.py:177
↓ 1 callers
Method
get_project_path
(self)
evaluation/patch_selection/trae_selector/sandbox.py:20
↓ 1 callers
Method
get_provider_name
Get the provider name for trajectory recording.
trae_agent/utils/llm_clients/openai_compatible_base.py:50
↓ 1 callers
Method
get_service_name
Get the service name for retry logging.
trae_agent/utils/llm_clients/openai_compatible_base.py:45
↓ 1 callers
Method
get_system_prompt
Get the system prompt for TraeAgent.
trae_agent/agent/trae_agent.py:172
↓ 1 callers
Method
get_task_input
Get task input from user (for interactive mode). Returns: Task string or None if user wants to exit
trae_agent/utils/cli/cli_console.py:96
← previous
next →
101–200 of 548, ranked by callers