MCPcopy Create free account

hub / github.com/Nardien/agent-distillation / functions

Functions494 in github.com/Nardien/agent-distillation

↓ 109 callersMethodappend
(self, text)
src/smolagents/local_python_executor.py:136
↓ 63 callersFunctionevaluate_ast
Evaluate an abstract syntax tree using the content of the variables stored in a state and only evaluating a given set of functions. This
src/smolagents/local_python_executor.py:1359
↓ 30 callersMethodlog
Logs a message to the console. Args: level (LogLevel, optional): Defaults to LogLevel.INFO.
src/smolagents/monitoring.py:92
↓ 13 callersMethodsearch
(self, query: str, num: int = None, return_score: bool = False)
search/retriever_server.py:149
↓ 10 callersMethodrun
Run the agent for the given task. Args: task (`str`): Task to perform. stream (`bool`): Whether to run in a
src/smolagents/agents.py:276
↓ 9 callersMethod__init__
( self, flatten_messages_as_text: bool = False, tool_name_key: str = "name", t
src/smolagents/models.py:262
↓ 9 callersMethoddecode
Uses the `post_processor` to decode the model output.
src/smolagents/tools.py:1068
↓ 9 callersFunctionpopulate_template
(template: str, variables: Dict[str, Any])
src/smolagents/agents.py:84
↓ 8 callersFunction_is_package_available
(package_name: str)
src/smolagents/utils.py:42
↓ 8 callersMethodto_messages
(self, summary_mode: bool = False, **kwargs)
src/smolagents/memory.py:185
↓ 7 callersMethod_prepare_completion_kwargs
Prepare parameters required for model invocation, handling parameter priorities. Parameter priority from high to low: 1. Exp
src/smolagents/models.py:276
↓ 6 callersMethoddict
(self)
src/smolagents/memory.py:31
↓ 6 callersFunctionset_value
( target: ast.AST, value: Any, state: Dict[str, Any], static_tools: Dict[str, Callable], c
src/smolagents/local_python_executor.py:761
↓ 6 callersFunctiontruncate_content
(content: str, max_length: int = MAX_LENGTH_TRUNCATE_CONTENT)
src/smolagents/utils.py:236
↓ 5 callersMethod__init__
(self, provider: str = "serpapi")
src/smolagents/default_tools.py:139
↓ 5 callersMethodencode
(self, query_list: List[str], is_query=True)
search/retriever_server.py:85
↓ 5 callersMethodencode
Uses the `pre_processor` to prepare the inputs for the `model`.
src/smolagents/tools.py:1053
↓ 5 callersMethodfrom_dict
(cls, model_dictionary: Dict[str, Any])
src/smolagents/models.py:398
↓ 5 callersFunctionget_source
Get the source code of a class or callable object (e.g.: function, method). First attempts to get the source code using `inspect.getsource`. I
src/smolagents/utils.py:385
↓ 5 callersMethodlog_markdown
(self, content: str, title: Optional[str] = None, level=LogLevel.INFO, style=YELLOW_HEX)
src/smolagents/monitoring.py:106
↓ 5 callersMethodpostprocess_message
Sometimes APIs fail to properly parse a tool call: this function tries to parse.
src/smolagents/models.py:861
↓ 5 callersFunctionremove_tool_call_from_messages
(messages: List[Dict[str, str]])
src/smolagents/models.py:246
↓ 5 callersFunctiontool
Convert a function into an instance of a dynamically created Tool subclass. Args: tool_function (`Callable`): Function to convert in
src/smolagents/tools.py:866
↓ 5 callersMethodwrite_memory_to_messages
Reads past llm_outputs, actions, and observations or errors from the memory into a series of messages that can be used as input to th
src/smolagents/agents.py:515
↓ 4 callersFunctionget_clean_message_list
Subsequent messages with the same role will be concatenated to a single message. output_message_list is a list of messages that will be used
src/smolagents/models.py:175
↓ 4 callersFunctionget_tool_call_from_text
(text: str, tool_name_key: str, tool_arguments_key: str)
src/smolagents/models.py:230
↓ 4 callersMethodlog_error
(self, error_message: str)
src/smolagents/monitoring.py:103
↓ 4 callersMethodrun_code_raise_errors
(self, code: str, return_final_answer: bool = False)
src/smolagents/remote_executors.py:52
↓ 4 callersFunctionsymbolic_equal
(a, b)
exps_research/unified_framework/math_utils/qwen_math_parser.py:834
↓ 4 callersFunctionsymbolic_equal
(a, b)
exps_research/unified_framework/math_utils/qwen_math_grader.py:285
↓ 4 callersFunctionsymbolic_equal
(a, b)
exps_research/unified_framework/processors/qwen_math_parser.py:834
↓ 4 callersMethodto_dict
Convert the agent to a dictionary representation. Returns: `dict`: Dictionary representation of the agent.
src/smolagents/agents.py:1606
↓ 4 callersMethodto_string
(self)
src/smolagents/agent_types.py:54
↓ 4 callersMethodupdate_cost
Update total cost and check threshold Args: cost: Cost to add (in USD) Returns:
exps_research/unified_framework/processors/cost_tracker.py:41
↓ 3 callersMethod__init__
(self, value)
src/smolagents/agent_types.py:42
↓ 3 callersMethod_handle_comprehension_generators
Helper method to handle generators in all types of comprehensions
src/smolagents/tool_validation.py:86
↓ 3 callersMethod_write_file
Writes content to a file with UTF-8 encoding.
src/smolagents/tools.py:293
↓ 3 callersFunctionappend_result
Append result to output file in thread-safe manner Args: result: Result dictionary to append output_file: Path to output
exps_research/unified_framework/utils.py:127
↓ 3 callersMethodget_token_counts
(self)
src/smolagents/models.py:330
↓ 3 callersFunctionget_tool_json_schema
(tool: Tool)
src/smolagents/models.py:146
↓ 3 callersFunctionhandle_agent_output_types
(output, output_type=None)
src/smolagents/agent_types.py:262
↓ 3 callersFunctionload_docs
(corpus, doc_idxs)
search/retriever_server.py:43
↓ 3 callersMethodlog_rule
(self, title: str, level: int = LogLevel.INFO)
src/smolagents/monitoring.py:144
↓ 3 callersFunctionmake_init_file
(folder: str | Path)
src/smolagents/utils.py:449
↓ 3 callersFunctionmath_equal
Exact match of math if and only if: 1. numerical equal: both can convert to float and are equal 2. symbolic equal: both can convert to sy
exps_research/unified_framework/math_utils/qwen_math_grader.py:73
↓ 3 callersFunctionparse_digits
(num)
exps_research/unified_framework/math_utils/qwen_math_parser.py:600
↓ 3 callersFunctionparse_digits
(num)
exps_research/unified_framework/math_utils/qwen_math_grader.py:39
↓ 3 callersFunctionparse_digits
(num)
exps_research/unified_framework/processors/qwen_math_parser.py:600
↓ 3 callersFunctionpreprocess_sft_dataset
(solution_type, datapath)
exps_research/train_utils/preprocess.py:98
↓ 3 callersMethodprocess_entry
Process a single experiment entry Args: entry: Dictionary containing a question/problem model: Model
exps_research/unified_framework/processors/base.py:113
↓ 3 callersFunctionremove_last_user_message
( messages )
exps_research/train_utils/preprocess.py:148
↓ 3 callersFunctionrun_experiment
Run an experiment with the unified framework - supports both agent and reasoning modes
exps_research/unified_framework/run_experiment.py:28
↓ 3 callersFunctionstrip_string
(string, skip_unit=False)
exps_research/unified_framework/math_utils/qwen_math_parser.py:238
↓ 3 callersMethodto_dict
Returns a dictionary representing the tool
src/smolagents/tools.py:202
↓ 3 callersMethodto_raw
(self)
src/smolagents/agent_types.py:48
↓ 2 callersMethod__init__
( self, retrieval_method: str = "bm25", retrieval_topk: int = 10, index_path
search/retriever_server.py:298
↓ 2 callersFunction_convert_type_hints_to_json_schema
(func: Callable, error_on_missing_type_hints: bool = True)
src/smolagents/_function_type_hints_utils.py:276
↓ 2 callersMethod_get_gradio_app_code
Get the Gradio app code.
src/smolagents/tools.py:375
↓ 2 callersMethod_get_requirements
Get the requirements.
src/smolagents/tools.py:388
↓ 2 callersMethod_get_tool_code
Get the tool's code.
src/smolagents/tools.py:371
↓ 2 callersFunction_parse
(s)
exps_research/unified_framework/math_utils/qwen_math_parser.py:835
↓ 2 callersFunction_parse
(s)
exps_research/unified_framework/math_utils/qwen_math_grader.py:286
↓ 2 callersFunction_parse
(s)
exps_research/unified_framework/processors/qwen_math_parser.py:835
↓ 2 callersMethod_run
( self, task: str, max_steps: int, images: List["PIL.Image.Image"] | None = None )
src/smolagents/agents.py:356
↓ 2 callersFunctioncalculate_cost
Calculate cost based on model pricing Args: input_tokens: Number of input tokens output_tokens: Number of output tokens
exps_research/unified_framework/utils.py:18
↓ 2 callersMethodcalculate_cost
Calculate the total cost of API calls based on token usage. Returns: dict: Dictionary containing cost information including:
src/smolagents/agents.py:1077
↓ 2 callersFunctioncheck_module_authorized
(module_name, authorized_imports)
src/smolagents/local_python_executor.py:1234
↓ 2 callersFunctionchoice_answer_clean
(pred: str)
exps_research/unified_framework/math_utils/qwen_math_parser.py:393
↓ 2 callersFunctionchoice_answer_clean
(pred: str)
exps_research/unified_framework/processors/qwen_math_parser.py:393
↓ 2 callersFunctionclean_messages
(messages)
exps_research/train_utils/preprocess.py:155
↓ 2 callersMethodcleanup
Clean up resources.
src/smolagents/remote_executors.py:339
↓ 2 callersMethodcreate_client
(self)
src/smolagents/models.py:1232
↓ 2 callersMethodcreate_model
Create a model instance for this worker Args: worker_id: ID of the worker thread/process use_local_m
exps_research/unified_framework/processors/base.py:127
↓ 2 callersFunctionencode_image_base64
(image)
src/smolagents/utils.py:439
↓ 2 callersFunctionescape_code_brackets
Escapes square brackets in code segments while preserving Rich styling tags.
src/smolagents/utils.py:65
↓ 2 callersFunctionestimate_len
(node, state)
src/smolagents/local_python_executor.py:205
↓ 2 callersFunctionfilter_agent_trajectories
(result_path, do_save=True)
exps_research/unified_framework/filter_agent_training_data.py:14
↓ 2 callersFunctionfix_final_answer_code
Sometimes an LLM can try to assign a variable to final_answer, which would break the final_answer() tool. This function fixes this behaviour
src/smolagents/local_python_executor.py:340
↓ 2 callersMethodfrom_code
(cls, tool_code: str, **kwargs)
src/smolagents/tools.py:448
↓ 2 callersMethodfrom_hf_api
(cls, message, raw)
src/smolagents/models.py:96
↓ 2 callersMethodfrom_hub
Loads a tool defined on the Hub. <Tip warning={true}> Loading a tool from the Hub means that you'll download the tool and e
src/smolagents/tools.py:393
↓ 2 callersFunctionget_dict_from_nested_dataclasses
(obj, ignore_key=None)
src/smolagents/models.py:46
↓ 2 callersFunctionget_method_source
Get source code for a method, including bound methods.
src/smolagents/utils.py:264
↓ 2 callersFunctionget_safe_module
Creates a safe copy of a module or returns the original if it's a function
src/smolagents/local_python_executor.py:1196
↓ 2 callersFunctionget_step_footnote_content
Get a footnote string for a step log with duration and token information
src/smolagents/gradio_ui.py:27
↓ 2 callersFunctionhandle_agent_input_types
(*args, **kwargs)
src/smolagents/agent_types.py:256
↓ 2 callersMethodinitialize_system_prompt
To be implemented in child classes
src/smolagents/agents.py:511
↓ 2 callersMethodinstall_packages
(self, additional_imports: List[str])
src/smolagents/remote_executors.py:88
↓ 2 callersFunctioninstance_to_source
Convert an instance to its class source code representation.
src/smolagents/utils.py:294
↓ 2 callersFunctionis_digit
(num)
exps_research/unified_framework/math_utils/qwen_math_parser.py:616
↓ 2 callersFunctionis_digit
(num)
exps_research/unified_framework/math_utils/qwen_math_grader.py:55
↓ 2 callersFunctionis_digit
(num)
exps_research/unified_framework/processors/qwen_math_parser.py:616
↓ 2 callersFunctionload_corpus
(corpus_path: str)
search/retriever_server.py:27
↓ 2 callersFunctionload_dataset
Load dataset from file Args: file_path: Path to dataset file Returns: List of examples
exps_research/unified_framework/utils.py:56
↓ 2 callersFunctionload_file_from_path
Load a file from the given path. Args: file_path (str): Path to the file. Returns: dataset (list): loaded d
exps_research/train_utils/preprocess.py:105
↓ 2 callersFunctionload_model
(model_type: str, model_id: str, api_base: str | None = None, api_key: str | None = None)
src/smolagents/cli.py:82
↓ 2 callersMethodlog_messages
(self, messages: List)
src/smolagents/monitoring.py:166
↓ 2 callersMethodlog_task
(self, content: str, subtitle: str, title: Optional[str] = None, level: int = LogLevel.INFO)
src/smolagents/monitoring.py:154
↓ 2 callersFunctionmake_json_serializable
Recursive function to make objects JSON serializable
src/smolagents/utils.py:127
↓ 2 callersFunctionmemoized_canonical_form
Compute a canonical form for a mathematical expression using sympy. Uses a shared cache across processes for memoization. Args:
exps_research/unified_framework/math_utils/group.py:28
next →1–100 of 494, ranked by callers