SYMBOL INDEX (1426 symbols across 61 files) FILE: examples/agent_from_any_llm.py function get_weather (line 43) | def get_weather(location: str, celsius: bool | None = False) -> str: FILE: examples/async_agent/main.py function get_agent (line 18) | def get_agent(): function run_agent_in_thread (line 26) | async def run_agent_in_thread(task: str): function run_agent_endpoint (line 33) | async def run_agent_endpoint(request: Request): FILE: examples/multiple_tools.py function get_weather (line 16) | def get_weather(location: str, celsius: bool | None = False) -> str: function convert_currency (line 52) | def convert_currency(amount: float, from_currency: str, to_currency: str... function get_news_headlines (line 88) | def get_news_headlines() -> str: function get_joke (line 119) | def get_joke() -> str: function get_time_in_timezone (line 148) | def get_time_in_timezone(location: str) -> str: function get_random_fact (line 174) | def get_random_fact() -> str: function search_wikipedia (line 195) | def search_wikipedia(query: str) -> str: FILE: examples/open_deep_research/run.py function parse_args (line 34) | def parse_args(): function create_agent (line 60) | def create_agent(model_id="o1"): function main (line 114) | def main(): FILE: examples/open_deep_research/run_gaia.py function parse_args (line 49) | def parse_args(): function create_agent_team (line 82) | def create_agent_team(model: Model, token_counts: TokenUsage): function load_gaia_dataset (line 137) | def load_gaia_dataset(use_raw_dataset: bool, set_to_run: str) -> dataset... function append_answer (line 172) | def append_answer(entry: dict, jsonl_file: str) -> None: function answer_single_question (line 181) | def answer_single_question( function get_examples_to_answer (line 275) | def get_examples_to_answer(answers_file: str, eval_ds: datasets.Dataset)... function main (line 287) | def main(): FILE: examples/open_deep_research/scripts/gaia_scorer.py function normalize_number_str (line 6) | def normalize_number_str(number_str: str) -> float: function split_string (line 18) | def split_string( function is_float (line 26) | def is_float(element: any) -> bool: function question_scorer (line 34) | def question_scorer( function check_prediction_contains_answer_letters_in_order (line 73) | def check_prediction_contains_answer_letters_in_order(prediction, true_a... function check_close_call (line 87) | def check_close_call(prediction, true_answer, is_correct): function normalize_str (line 104) | def normalize_str(input_str, remove_punct=True) -> str: FILE: examples/open_deep_research/scripts/mdconvert.py class _CustomMarkdownify (line 37) | class _CustomMarkdownify(markdownify.MarkdownConverter): method __init__ (line 47) | def __init__(self, **options: Any): method convert_hn (line 52) | def convert_hn(self, n: int, el: Any, text: str, convert_as_inline: bo... method convert_a (line 60) | def convert_a(self, el: Any, text: str, convert_as_inline: bool): method convert_img (line 92) | def convert_img(self, el: Any, text: str, convert_as_inline: bool) -> ... method convert_soup (line 108) | def convert_soup(self, soup: Any) -> str: class DocumentConverterResult (line 112) | class DocumentConverterResult: method __init__ (line 115) | def __init__(self, title: str | None = None, text_content: str = ""): class DocumentConverter (line 120) | class DocumentConverter: method convert (line 123) | def convert(self, local_path: str, **kwargs: Any) -> None | DocumentCo... class PlainTextConverter (line 127) | class PlainTextConverter(DocumentConverter): method convert (line 130) | def convert(self, local_path: str, **kwargs: Any) -> None | DocumentCo... class HtmlConverter (line 149) | class HtmlConverter(DocumentConverter): method convert (line 152) | def convert(self, local_path: str, **kwargs: Any) -> None | DocumentCo... method _convert (line 164) | def _convert(self, html_content: str) -> None | DocumentConverterResult: class WikipediaConverter (line 189) | class WikipediaConverter(DocumentConverter): method convert (line 192) | def convert(self, local_path: str, **kwargs: Any) -> None | DocumentCo... class YouTubeConverter (line 234) | class YouTubeConverter(DocumentConverter): method convert (line 237) | def convert(self, local_path: str, **kwargs: Any) -> None | DocumentCo... method _get (line 331) | def _get(self, metadata: dict[str, str], keys: list[str], default: str... method _findKey (line 337) | def _findKey(self, json: Any, key: str) -> str | None: # TODO: Fix js... class PdfConverter (line 354) | class PdfConverter(DocumentConverter): method convert (line 359) | def convert(self, local_path, **kwargs) -> None | DocumentConverterRes... class DocxConverter (line 371) | class DocxConverter(HtmlConverter): method convert (line 376) | def convert(self, local_path, **kwargs) -> None | DocumentConverterRes... class XlsxConverter (line 391) | class XlsxConverter(HtmlConverter): method convert (line 396) | def convert(self, local_path, **kwargs) -> None | DocumentConverterRes... class PptxConverter (line 415) | class PptxConverter(HtmlConverter): method convert (line 420) | def convert(self, local_path, **kwargs) -> None | DocumentConverterRes... method _is_picture (line 487) | def _is_picture(self, shape): method _is_table (line 495) | def _is_table(self, shape): class MediaConverter (line 501) | class MediaConverter(DocumentConverter): method _get_metadata (line 506) | def _get_metadata(self, local_path): class WavConverter (line 518) | class WavConverter(MediaConverter): method convert (line 523) | def convert(self, local_path, **kwargs) -> None | DocumentConverterRes... method _transcribe_audio (line 561) | def _transcribe_audio(self, local_path) -> str: class Mp3Converter (line 568) | class Mp3Converter(WavConverter): method convert (line 573) | def convert(self, local_path, **kwargs) -> None | DocumentConverterRes... class ZipConverter (line 631) | class ZipConverter(DocumentConverter): method __init__ (line 636) | def __init__(self, extract_dir: str = "downloads"): method convert (line 647) | def convert(self, local_path: str, **kwargs: Any) -> None | DocumentCo... class ImageConverter (line 679) | class ImageConverter(MediaConverter): method convert (line 684) | def convert(self, local_path, **kwargs) -> None | DocumentConverterRes... method _get_mlm_description (line 727) | def _get_mlm_description(self, local_path, extension, client, model, p... class FileConversionException (line 760) | class FileConversionException(Exception): class UnsupportedFormatException (line 764) | class UnsupportedFormatException(Exception): class MarkdownConverter (line 768) | class MarkdownConverter: method __init__ (line 772) | def __init__( method convert (line 804) | def convert( method convert_local (line 823) | def convert_local(self, path: str, **kwargs: Any) -> DocumentConverter... method convert_stream (line 837) | def convert_stream(self, stream: Any, **kwargs: Any) -> DocumentConver... method convert_url (line 870) | def convert_url(self, url: str, **kwargs: Any) -> DocumentConverterRes... method convert_response (line 877) | def convert_response( method _convert (line 927) | def _convert(self, local_path: str, extensions: list[str | None], **kw... method _append_ext (line 972) | def _append_ext(self, extensions, ext): method _guess_ext_magic (line 983) | def _guess_ext_magic(self, path): method register_page_converter (line 1000) | def register_page_converter(self, converter: DocumentConverter) -> None: FILE: examples/open_deep_research/scripts/reformulator.py function prepare_response (line 8) | def prepare_response(original_task: str, inner_messages, reformulation_m... FILE: examples/open_deep_research/scripts/run_agents.py function serialize_agent_error (line 11) | def serialize_agent_error(obj): function get_image_description (line 18) | def get_image_description(file_name: str, question: str, visual_inspecti... function get_document_description (line 25) | def get_document_description(file_path: str, question: str, document_ins... function get_single_file_description (line 32) | def get_single_file_description(file_path: str, question: str, visual_in... function get_zip_description (line 56) | def get_zip_description(file_path: str, question: str, visual_inspection... function get_tasks_to_run (line 72) | def get_tasks_to_run(data, total: int, base_filename: Path, tasks_ids: l... FILE: examples/open_deep_research/scripts/text_inspector_tool.py class TextInspectorTool (line 5) | class TextInspectorTool(Tool): method __init__ (line 24) | def __init__(self, model: Model = None, text_limit: int = 100000): method forward_initial_exam_mode (line 32) | def forward_initial_exam_mode(self, file_path, question): method forward (line 76) | def forward(self, file_path, question: str | None = None) -> str: FILE: examples/open_deep_research/scripts/text_web_browser.py class SimpleTextBrowser (line 22) | class SimpleTextBrowser: method __init__ (line 25) | def __init__( method address (line 51) | def address(self) -> str: method set_address (line 55) | def set_address(self, uri_or_path: str, filter_year: int | None = None... method viewport (line 82) | def viewport(self) -> str: method page_content (line 88) | def page_content(self) -> str: method _set_page_content (line 92) | def _set_page_content(self, content: str) -> None: method page_down (line 99) | def page_down(self) -> None: method page_up (line 102) | def page_up(self) -> None: method find_on_page (line 105) | def find_on_page(self, query: str) -> str | None: method find_next (line 124) | def find_next(self) -> str | None: method _find_next_viewport (line 147) | def _find_next_viewport(self, query: str, starting_viewport: int) -> i... method visit_page (line 177) | def visit_page(self, path_or_uri: str, filter_year: int | None = None)... method _split_pages (line 182) | def _split_pages(self) -> None: method _serpapi_search (line 204) | def _serpapi_search(self, query: str, filter_year: int | None = None) ... method _fetch_page (line 263) | def _fetch_page(self, url: str) -> None: method _state (line 355) | def _state(self) -> tuple[str, str]: class SearchInformationTool (line 373) | class SearchInformationTool(Tool): method __init__ (line 384) | def __init__(self, browser): method forward (line 388) | def forward(self, query: str, filter_year: int | None = None) -> str: class VisitTool (line 394) | class VisitTool(Tool): method __init__ (line 400) | def __init__(self, browser=None): method forward (line 404) | def forward(self, url: str) -> str: class DownloadTool (line 410) | class DownloadTool(Tool): method __init__ (line 419) | def __init__(self, browser): method forward (line 423) | def forward(self, url: str) -> str: class ArchiveSearchTool (line 445) | class ArchiveSearchTool(Tool): method __init__ (line 457) | def __init__(self, browser=None): method forward (line 461) | def forward(self, url, date) -> str: class PageUpTool (line 488) | class PageUpTool(Tool): method __init__ (line 494) | def __init__(self, browser=None): method forward (line 498) | def forward(self) -> str: class PageDownTool (line 504) | class PageDownTool(Tool): method __init__ (line 512) | def __init__(self, browser=None): method forward (line 516) | def forward(self) -> str: class FinderTool (line 522) | class FinderTool(Tool): method __init__ (line 533) | def __init__(self, browser=None): method forward (line 537) | def forward(self, search_string: str) -> str: class FindNextTool (line 550) | class FindNextTool(Tool): method __init__ (line 556) | def __init__(self, browser=None): method forward (line 560) | def forward(self) -> str: FILE: examples/open_deep_research/scripts/visual_qa.py function process_images_and_text (line 19) | def process_images_and_text(image_path, query, client): function encode_image (line 66) | def encode_image(image_path): function resize_image (line 96) | def resize_image(image_path): class VisualQATool (line 105) | class VisualQATool(Tool): method forward (line 119) | def forward(self, image_path: str, question: str | None = None) -> str: function visualizer (line 142) | def visualizer(image_path: str, question: str | None = None) -> str: FILE: examples/plan_customization/plan_customization.py function display_plan (line 18) | def display_plan(plan_content): function get_user_choice (line 27) | def get_user_choice(): function get_modified_plan (line 36) | def get_modified_plan(original_plan): function interrupt_after_plan (line 62) | def interrupt_after_plan(memory_step, agent): function main (line 100) | def main(): FILE: examples/rag.py class RetrieverTool (line 29) | class RetrieverTool(Tool): method __init__ (line 40) | def __init__(self, docs, **kwargs): method forward (line 44) | def forward(self, query: str) -> str: FILE: examples/rag_using_chromadb.py class RetrieverTool (line 71) | class RetrieverTool(Tool): method __init__ (line 84) | def __init__(self, vector_store, **kwargs): method forward (line 88) | def forward(self, query: str) -> str: FILE: examples/server/main.py function shutdown (line 24) | async def shutdown(): function homepage (line 28) | async def homepage(request): function chat (line 197) | async def chat(request): FILE: examples/smolagents_benchmark/run.py function parse_arguments (line 33) | def parse_arguments(): function load_eval_dataset (line 91) | def load_eval_dataset(eval_dataset): function serialize_agent_error (line 103) | def serialize_agent_error(obj): function append_answer (line 110) | def append_answer(entry: dict, jsonl_file: str) -> None: function answer_single_question (line 125) | def answer_single_question(example, model, answers_file, action_type): function answer_questions (line 188) | def answer_questions( FILE: examples/structured_output_tool.py function weather_server_script (line 22) | def weather_server_script() -> str: function main (line 55) | def main() -> None: FILE: examples/text_to_sql.py function sql_engine (line 51) | def sql_engine(query: str) -> str: FILE: src/smolagents/_function_type_hints_utils.py function get_package_name (line 46) | def get_package_name(import_name: str) -> str: function get_imports (line 59) | def get_imports(code: str) -> list[str]: class TypeHintParsingException (line 89) | class TypeHintParsingException(Exception): class DocstringParsingException (line 93) | class DocstringParsingException(Exception): function get_json_schema (line 97) | def get_json_schema(func: Callable) -> dict: function _parse_google_format_docstring (line 256) | def _parse_google_format_docstring( function _convert_type_hints_to_json_schema (line 291) | def _convert_type_hints_to_json_schema(func: Callable, error_on_missing_... function _parse_type_hint (line 326) | def _parse_type_hint(hint: type) -> dict: function _parse_union_type (line 387) | def _parse_union_type(args: tuple[Any, ...]) -> dict: function _get_json_schema_type (line 415) | def _get_json_schema_type(param_type: type) -> dict[str, str]: FILE: src/smolagents/agent_types.py class AgentType (line 32) | class AgentType: method __init__ (line 43) | def __init__(self, value): method __str__ (line 46) | def __str__(self): method to_raw (line 49) | def to_raw(self): method to_string (line 55) | def to_string(self) -> str: class AgentText (line 62) | class AgentText(AgentType, str): method to_raw (line 67) | def to_raw(self): method to_string (line 70) | def to_string(self): class AgentImage (line 74) | class AgentImage(AgentType, PIL.Image.Image): method __init__ (line 79) | def __init__(self, value): method _ipython_display_ (line 111) | def _ipython_display_(self, include=None, exclude=None): method to_raw (line 119) | def to_raw(self): method to_string (line 136) | def to_string(self): method save (line 164) | def save(self, output_bytes, format: str = None, **params): class AgentAudio (line 176) | class AgentAudio(AgentType, str): method __init__ (line 181) | def __init__(self, value, samplerate=16_000): method _ipython_display_ (line 208) | def _ipython_display_(self, include=None, exclude=None): method to_raw (line 216) | def to_raw(self): method to_string (line 237) | def to_string(self): function handle_agent_input_types (line 257) | def handle_agent_input_types(*args, **kwargs): function handle_agent_output_types (line 263) | def handle_agent_output_types(output: Any, output_type: str | None = Non... FILE: src/smolagents/agents.py function populate_template (line 102) | def populate_template(template: str, variables: dict[str, Any]) -> str: class ActionOutput (line 111) | class ActionOutput: class ToolOutput (line 117) | class ToolOutput: class PlanningPromptTemplate (line 125) | class PlanningPromptTemplate(TypedDict): class ManagedAgentPromptTemplate (line 140) | class ManagedAgentPromptTemplate(TypedDict): class FinalAnswerPromptTemplate (line 153) | class FinalAnswerPromptTemplate(TypedDict): class PromptTemplates (line 166) | class PromptTemplates(TypedDict): class RunResult (line 196) | class RunResult: method __init__ (line 217) | def __init__(self, output=None, state=None, steps=None, token_usage=No... method messages (line 237) | def messages(self): method dict (line 246) | def dict(self): class MultiStepAgent (line 268) | class MultiStepAgent(ABC): method __init__ (line 294) | def __init__( method system_prompt (line 355) | def system_prompt(self) -> str: method system_prompt (line 359) | def system_prompt(self, value: str): method _validate_name (line 364) | def _validate_name(self, name: str | None) -> str | None: method _setup_managed_agents (line 369) | def _setup_managed_agents(self, managed_agents: list | None = None) ->... method _setup_tools (line 389) | def _setup_tools(self, tools, add_base_tools): method _validate_tools_and_managed_agents (line 404) | def _validate_tools_and_managed_agents(self, tools, managed_agents): method _setup_step_callbacks (line 416) | def _setup_step_callbacks(self, step_callbacks): method run (line 436) | def run( method _run_stream (line 540) | def _run_stream( method _validate_final_answer (line 613) | def _validate_final_answer(self, final_answer: Any): method _finalize_step (line 620) | def _finalize_step(self, memory_step: ActionStep | PlanningStep | Fina... method _handle_max_steps_reached (line 625) | def _handle_max_steps_reached(self, task: str) -> Any: method _generate_planning_step (line 639) | def _generate_planning_step( method initialize_system_prompt (line 750) | def initialize_system_prompt(self) -> str: method interrupt (line 754) | def interrupt(self): method write_memory_to_messages (line 758) | def write_memory_to_messages( method _step_stream (line 772) | def _step_stream( method step (line 782) | def step(self, memory_step: ActionStep) -> Any: method extract_action (line 789) | def extract_action(self, model_output: str, split_token: str) -> tuple... method provide_final_answer (line 810) | def provide_final_answer(self, task: str) -> ChatMessage: method visualize (line 855) | def visualize(self): method replay (line 859) | def replay(self, detailed: bool = False): method __call__ (line 868) | def __call__(self, task: str, **kwargs): method save (line 892) | def save(self, output_dir: str | Path, relative_path: str | None = None): method to_dict (line 970) | def to_dict(self) -> dict[str, Any]: method from_dict (line 1011) | def from_dict(cls, agent_dict: dict[str, Any], **kwargs) -> "MultiStep... method from_hub (line 1065) | def from_hub( method from_folder (line 1119) | def from_folder(cls, folder: str | Path, **kwargs): method push_to_hub (line 1160) | def push_to_hub( class ToolCallingAgent (line 1215) | class ToolCallingAgent(MultiStepAgent): method __init__ (line 1231) | def __init__( method tools_and_managed_agents (line 1261) | def tools_and_managed_agents(self): method initialize_system_prompt (line 1265) | def initialize_system_prompt(self) -> str: method _step_stream (line 1276) | def _step_stream( method process_tool_calls (line 1361) | def process_tool_calls( method _substitute_state_variables (line 1444) | def _substitute_state_variables(self, arguments: dict[str, str] | str)... method execute_tool_call (line 1453) | def execute_tool_call(self, tool_name: str, arguments: dict[str, str] ... class CodeAgent (line 1505) | class CodeAgent(MultiStepAgent): method __init__ (line 1527) | def __init__( method __enter__ (line 1587) | def __enter__(self): method __exit__ (line 1590) | def __exit__(self, exc_type, exc_value, traceback): method cleanup (line 1593) | def cleanup(self): method create_python_executor (line 1598) | def create_python_executor(self) -> PythonExecutor: method initialize_system_prompt (line 1621) | def initialize_system_prompt(self) -> str: method _step_stream (line 1639) | def _step_stream( method to_dict (line 1767) | def to_dict(self) -> dict[str, Any]: method from_dict (line 1781) | def from_dict(cls, agent_dict: dict[str, Any], **kwargs) -> "CodeAgent": FILE: src/smolagents/cli.py function parse_arguments (line 45) | def parse_arguments(): function interactive_mode (line 110) | def interactive_mode(): function load_model (line 188) | def load_model( function run_smolagent (line 219) | def run_smolagent( function main (line 262) | def main() -> None: FILE: src/smolagents/default_tools.py class PreTool (line 30) | class PreTool: class PythonInterpreterTool (line 39) | class PythonInterpreterTool(Tool): method __init__ (line 50) | def __init__(self, *args, authorized_imports=None, timeout_seconds=MAX... method forward (line 69) | def forward(self, code: str) -> str: class FinalAnswerTool (line 83) | class FinalAnswerTool(Tool): method forward (line 89) | def forward(self, answer: Any) -> Any: class UserInputTool (line 93) | class UserInputTool(Tool): method forward (line 99) | def forward(self, question): class DuckDuckGoSearchTool (line 104) | class DuckDuckGoSearchTool(Tool): method __init__ (line 126) | def __init__(self, max_results: int = 10, rate_limit: float | None = 1... method forward (line 140) | def forward(self, query: str) -> str: method _enforce_rate_limit (line 148) | def _enforce_rate_limit(self) -> None: class GoogleSearchTool (line 162) | class GoogleSearchTool(Tool): method __init__ (line 175) | def __init__(self, provider: str = "serpapi"): method forward (line 190) | def forward(self, query: str, filter_year: int | None = None) -> str: class ApiWebSearchTool (line 249) | class ApiWebSearchTool(Tool): method __init__ (line 278) | def __init__( method _enforce_rate_limit (line 299) | def _enforce_rate_limit(self) -> None: method forward (line 312) | def forward(self, query: str) -> str: method extract_results (line 323) | def extract_results(self, data: dict) -> list: method format_markdown (line 331) | def format_markdown(self, results: list) -> str: class WebSearchTool (line 342) | class WebSearchTool(Tool): method __init__ (line 348) | def __init__(self, max_results: int = 10, engine: str = "duckduckgo"): method forward (line 353) | def forward(self, query: str) -> str: method search (line 359) | def search(self, query: str) -> list: method parse_results (line 367) | def parse_results(self, results: list) -> str: method search_duckduckgo (line 372) | def search_duckduckgo(self, query: str) -> list: method _create_duckduckgo_parser (line 385) | def _create_duckduckgo_parser(self): method search_bing (line 431) | def search_bing(self, query: str) -> list: class VisitWebpageTool (line 454) | class VisitWebpageTool(Tool): method __init__ (line 467) | def __init__(self, max_output_length: int = 40000): method _truncate_content (line 471) | def _truncate_content(self, content: str, max_length: int) -> str: method forward (line 478) | def forward(self, url: str) -> str: class WikipediaSearchTool (line 510) | class WikipediaSearchTool(Tool): method __init__ (line 550) | def __init__( method forward (line 586) | def forward(self, query: str) -> str: class SpeechToTextTool (line 609) | class SpeechToTextTool(PipelineTool): method __new__ (line 621) | def __new__(cls, *args, **kwargs): method encode (line 628) | def encode(self, audio): method forward (line 634) | def forward(self, inputs): method decode (line 637) | def decode(self, outputs): FILE: src/smolagents/gradio_ui.py function get_step_footnote_content (line 29) | def get_step_footnote_content(step_log: ActionStep | PlanningStep, step_... function _clean_model_output (line 39) | def _clean_model_output(model_output: str) -> str: function _format_code_content (line 59) | def _format_code_content(content: str) -> str: function _process_action_step (line 80) | def _process_action_step(step_log: ActionStep, skip_model_outputs: bool ... function _process_planning_step (line 166) | def _process_planning_step(step_log: PlanningStep, skip_model_outputs: b... function _process_final_answer_step (line 189) | def _process_final_answer_step(step_log: FinalAnswerStep) -> Generator: function pull_messages_from_step (line 226) | def pull_messages_from_step(step_log: ActionStep | PlanningStep | FinalA... function stream_to_gradio (line 248) | def stream_to_gradio( class GradioUI (line 279) | class GradioUI: method __init__ (line 310) | def __init__(self, agent: MultiStepAgent, file_upload_folder: str | No... method _save_uploaded_file (line 324) | def _save_uploaded_file(self, file_path: str) -> str: method upload_file (line 335) | def upload_file(self, file, file_uploads_log: list, allowed_file_types... method _process_message (line 362) | def _process_message(self, message: str | dict) -> tuple[str, list[str... method _stream_response (line 378) | def _stream_response(self, message: str | dict, history: list[dict]) -... method launch (line 422) | def launch(self, share: bool = True, **kwargs): method create_app (line 432) | def create_app(self): FILE: src/smolagents/local_python_executor.py class InterpreterError (line 42) | class InterpreterError(ValueError): function custom_print (line 64) | def custom_print(*args): function nodunder_getattr (line 68) | def nodunder_getattr(obj, name, default=None): function check_safer_result (line 156) | def check_safer_result(result: Any, static_tools: dict[str, Callable] = ... function safer_eval (line 185) | def safer_eval(func: Callable): function safer_func (line 211) | def safer_func( class PrintContainer (line 240) | class PrintContainer: method __init__ (line 241) | def __init__(self): method append (line 244) | def append(self, text): method __iadd__ (line 248) | def __iadd__(self, other): method __str__ (line 253) | def __str__(self): method __repr__ (line 257) | def __repr__(self): method __len__ (line 261) | def __len__(self): class BreakException (line 266) | class BreakException(Exception): class ContinueException (line 270) | class ContinueException(Exception): class ReturnException (line 274) | class ReturnException(Exception): method __init__ (line 275) | def __init__(self, value): class ExecutionTimeoutError (line 279) | class ExecutionTimeoutError(Exception): function timeout (line 285) | def timeout(timeout_seconds: int): function get_iterable (line 323) | def get_iterable(obj): function fix_final_answer_code (line 332) | def fix_final_answer_code(code: str) -> str: function build_import_tree (line 360) | def build_import_tree(authorized_imports: list[str]) -> dict[str, Any]: function check_import_authorized (line 372) | def check_import_authorized(import_to_check: str, authorized_imports: li... function evaluate_attribute (line 383) | def evaluate_attribute( function evaluate_unaryop (line 396) | def evaluate_unaryop( function evaluate_lambda (line 416) | def evaluate_lambda( function evaluate_while (line 440) | def evaluate_while( function create_function (line 462) | def create_function( function evaluate_function_def (line 529) | def evaluate_function_def( function evaluate_class_def (line 540) | def evaluate_class_def( function evaluate_annassign (line 621) | def evaluate_annassign( function evaluate_augassign (line 638) | def evaluate_augassign( function evaluate_boolop (line 710) | def evaluate_boolop( function evaluate_binop (line 730) | def evaluate_binop( function evaluate_assign (line 770) | def evaluate_assign( function set_value (line 794) | def set_value( function evaluate_call (line 825) | def evaluate_call( function evaluate_subscript (line 921) | def evaluate_subscript( function evaluate_name (line 941) | def evaluate_name( function evaluate_condition (line 962) | def evaluate_condition( function evaluate_if (line 1004) | def evaluate_if( function evaluate_for (line 1026) | def evaluate_for( function _evaluate_comprehensions (line 1056) | def _evaluate_comprehensions( function evaluate_listcomp (line 1099) | def evaluate_listcomp( function evaluate_setcomp (line 1118) | def evaluate_setcomp( function evaluate_dictcomp (line 1137) | def evaluate_dictcomp( function evaluate_try (line 1159) | def evaluate_try( function evaluate_raise (line 1194) | def evaluate_raise( function evaluate_assert (line 1218) | def evaluate_assert( function evaluate_with (line 1236) | def evaluate_with( function get_safe_module (line 1271) | def get_safe_module(raw_module, authorized_imports, visited=None): function evaluate_import (line 1309) | def evaluate_import(expression, state, authorized_imports): function evaluate_generatorexp (line 1345) | def evaluate_generatorexp( function evaluate_delete (line 1380) | def evaluate_delete( function evaluate_ast (line 1417) | def evaluate_ast( class FinalAnswerException (line 1572) | class FinalAnswerException(BaseException): method __init__ (line 1579) | def __init__(self, value): function evaluate_python_code (line 1583) | def evaluate_python_code( class CodeOutput (line 1671) | class CodeOutput: class PythonExecutor (line 1677) | class PythonExecutor(ABC): method send_tools (line 1679) | def send_tools(self, tools: dict[str, Tool]) -> None: ... method send_variables (line 1682) | def send_variables(self, variables: dict[str, Any]) -> None: ... method __call__ (line 1685) | def __call__(self, code_action: str) -> CodeOutput: ... class LocalPythonExecutor (line 1688) | class LocalPythonExecutor(PythonExecutor): method __init__ (line 1708) | def __init__( method _check_authorized_imports_are_installed (line 1727) | def _check_authorized_imports_are_installed(self): method __call__ (line 1747) | def __call__(self, code_action: str) -> CodeOutput: method send_variables (line 1760) | def send_variables(self, variables: dict[str, Any]): method send_tools (line 1763) | def send_tools(self, tools: dict[str, Tool]): FILE: src/smolagents/mcp_client.py class MCPClient (line 33) | class MCPClient: method __init__ (line 85) | def __init__( method connect (line 124) | def connect(self): method disconnect (line 128) | def disconnect( method get_tools (line 137) | def get_tools(self) -> list[Tool]: method __enter__ (line 156) | def __enter__(self) -> list[Tool]: method __exit__ (line 164) | def __exit__( FILE: src/smolagents/memory.py class ToolCall (line 25) | class ToolCall: method dict (line 30) | def dict(self): class MemoryStep (line 42) | class MemoryStep: method dict (line 43) | def dict(self): method to_messages (line 46) | def to_messages(self, summary_mode: bool = False) -> list[ChatMessage]: class ActionStep (line 51) | class ActionStep(MemoryStep): method dict (line 66) | def dict(self): method to_messages (line 92) | def to_messages(self, summary_mode: bool = False) -> list[ChatMessage]: class PlanningStep (line 154) | class PlanningStep(MemoryStep): method dict (line 161) | def dict(self): method to_messages (line 174) | def to_messages(self, summary_mode: bool = False) -> list[ChatMessage]: class TaskStep (line 187) | class TaskStep(MemoryStep): method to_messages (line 191) | def to_messages(self, summary_mode: bool = False) -> list[ChatMessage]: class SystemPromptStep (line 200) | class SystemPromptStep(MemoryStep): method to_messages (line 203) | def to_messages(self, summary_mode: bool = False) -> list[ChatMessage]: class FinalAnswerStep (line 210) | class FinalAnswerStep(MemoryStep): class AgentMemory (line 214) | class AgentMemory: method __init__ (line 228) | def __init__(self, system_prompt: str): method reset (line 232) | def reset(self): method get_succinct_steps (line 236) | def get_succinct_steps(self) -> list[dict]: method get_full_steps (line 242) | def get_full_steps(self) -> list[dict]: method replay (line 248) | def replay(self, logger: AgentLogger, detailed: bool = False): method return_full_code (line 273) | def return_full_code(self) -> str: class CallbackRegistry (line 280) | class CallbackRegistry: method __init__ (line 286) | def __init__(self): method register (line 289) | def register(self, step_cls: Type[MemoryStep], callback: Callable): method callback (line 300) | def callback(self, memory_step, **kwargs): FILE: src/smolagents/models.py function get_dict_from_nested_dataclasses (line 70) | def get_dict_from_nested_dataclasses(obj, ignore_key=None): function remove_content_after_stop_sequences (line 79) | def remove_content_after_stop_sequences(content: str | None, stop_sequen... class ChatMessageToolCallFunction (line 95) | class ChatMessageToolCallFunction: class ChatMessageToolCall (line 102) | class ChatMessageToolCall: method __str__ (line 107) | def __str__(self) -> str: class MessageRole (line 111) | class MessageRole(str, Enum): method roles (line 119) | def roles(cls): class ChatMessage (line 124) | class ChatMessage: method __post_init__ (line 131) | def __post_init__(self) -> None: method model_dump_json (line 136) | def model_dump_json(self): method from_dict (line 140) | def from_dict(cls, data: dict, raw: Any | None = None, token_usage: To... method dict (line 157) | def dict(self): method render_as_markdown (line 160) | def render_as_markdown(self) -> str: function _coerce_tool_call (line 172) | def _coerce_tool_call(tool_call: Any) -> ChatMessageToolCall: function parse_json_if_needed (line 193) | def parse_json_if_needed(arguments: str | dict) -> str | dict: class ChatMessageToolCallStreamDelta (line 204) | class ChatMessageToolCallStreamDelta: class ChatMessageStreamDelta (line 214) | class ChatMessageStreamDelta: function agglomerate_stream_deltas (line 220) | def agglomerate_stream_deltas( function get_tool_json_schema (line 288) | def get_tool_json_schema(tool: Tool) -> dict: function get_clean_message_list (line 332) | def get_clean_message_list( function get_tool_call_from_text (line 400) | def get_tool_call_from_text(text: str, tool_name_key: str, tool_argument... function supports_stop_parameter (line 418) | def supports_stop_parameter(model_id: str) -> bool: class _ParameterRemove (line 441) | class _ParameterRemove: method __repr__ (line 444) | def __repr__(self): class Model (line 452) | class Model: method __init__ (line 484) | def __init__( method supports_stop_parameter (line 499) | def supports_stop_parameter(self) -> bool: method _prepare_completion_kwargs (line 502) | def _prepare_completion_kwargs( method generate (line 553) | def generate( method __call__ (line 580) | def __call__(self, *args, **kwargs): method parse_tool_calls (line 583) | def parse_tool_calls(self, message: ChatMessage) -> ChatMessage: method to_dict (line 596) | def to_dict(self) -> dict: method from_dict (line 629) | def from_dict(cls, model_dictionary: dict[str, Any]) -> "Model": class VLLMModel (line 633) | class VLLMModel(Model): method __init__ (line 648) | def __init__( method cleanup (line 670) | def cleanup(self): method generate (line 687) | def generate( class MLXModel (line 751) | class MLXModel(Model): method __init__ (line 791) | def __init__( method generate (line 816) | def generate( class TransformersModel (line 860) | class TransformersModel(Model): method __init__ (line 906) | def __init__( method make_stopping_criteria (line 980) | def make_stopping_criteria(self, stop_sequences: list[str], tokenizer)... method _prepare_completion_args (line 1001) | def _prepare_completion_args( method generate (line 1052) | def generate( method generate_stream (line 1093) | def generate_stream( class ApiModel (line 1138) | class ApiModel(Model): method __init__ (line 1161) | def __init__( method create_client (line 1185) | def create_client(self): method _apply_rate_limit (line 1189) | def _apply_rate_limit(self): function is_rate_limit_error (line 1194) | def is_rate_limit_error(exception: BaseException) -> bool: class LiteLLMModel (line 1205) | class LiteLLMModel(ApiModel): method __init__ (line 1224) | def __init__( method create_client (line 1255) | def create_client(self): method generate (line 1266) | def generate( method generate_stream (line 1309) | def generate_stream( class LiteLLMRouterModel (line 1363) | class LiteLLMRouterModel(LiteLLMModel): method __init__ (line 1426) | def __init__( method create_client (line 1446) | def create_client(self): class InferenceClientModel (line 1456) | class InferenceClientModel(ApiModel): method __init__ (line 1514) | def __init__( method create_client (line 1547) | def create_client(self): method generate (line 1553) | def generate( method generate_stream (line 1591) | def generate_stream( class OpenAIModel (line 1646) | class OpenAIModel(ApiModel): method __init__ (line 1671) | def __init__( method create_client (line 1697) | def create_client(self): method generate_stream (line 1707) | def generate_stream( method generate (line 1761) | def generate( class AzureOpenAIModel (line 1799) | class AzureOpenAIModel(OpenAIModel): method __init__ (line 1820) | def __init__( method create_client (line 1845) | def create_client(self): class AmazonBedrockModel (line 1859) | class AmazonBedrockModel(ApiModel): method __init__ (line 1940) | def __init__( method _prepare_completion_kwargs (line 1968) | def _prepare_completion_kwargs( method create_client (line 2010) | def create_client(self): method generate (line 2020) | def generate( FILE: src/smolagents/monitoring.py class TokenUsage (line 37) | class TokenUsage: method __post_init__ (line 46) | def __post_init__(self): method dict (line 49) | def dict(self): class Timing (line 58) | class Timing: method duration (line 67) | def duration(self): method dict (line 70) | def dict(self): method __repr__ (line 77) | def __repr__(self) -> str: class Monitor (line 81) | class Monitor: method __init__ (line 82) | def __init__(self, tracked_model, logger): method get_total_token_counts (line 89) | def get_total_token_counts(self) -> TokenUsage: method reset (line 95) | def reset(self): method update_metrics (line 100) | def update_metrics(self, step_log): class LogLevel (line 120) | class LogLevel(IntEnum): class AgentLogger (line 130) | class AgentLogger: method __init__ (line 131) | def __init__(self, level: LogLevel = LogLevel.INFO, console: Console |... method log (line 138) | def log(self, *args, level: int | str | LogLevel = LogLevel.INFO, **kw... method log_error (line 149) | def log_error(self, error_message: str) -> None: method log_markdown (line 152) | def log_markdown(self, content: str, title: str | None = None, level=L... method log_code (line 174) | def log_code(self, title: str, content: str, level: int = LogLevel.INF... method log_rule (line 190) | def log_rule(self, title: str, level: int = LogLevel.INFO) -> None: method log_task (line 200) | def log_task(self, content: str, subtitle: str, title: str | None = No... method log_messages (line 220) | def log_messages(self, messages: list[dict], level: LogLevel = LogLeve... method visualize_agent_tree (line 232) | def visualize_agent_tree(self, agent): FILE: src/smolagents/remote_executors.py class RemotePythonExecutor (line 56) | class RemotePythonExecutor(PythonExecutor): method __init__ (line 73) | def __init__( method run_code_raise_errors (line 85) | def run_code_raise_errors(self, code: str) -> CodeOutput: method send_tools (line 97) | def send_tools(self, tools: dict[str, Tool]): method send_variables (line 118) | def send_variables(self, variables: dict[str, Any]): method __call__ (line 136) | def __call__(self, code_action: str) -> CodeOutput: method install_packages (line 140) | def install_packages(self, additional_imports: list[str]): method _patch_final_answer_with_exception (line 146) | def _patch_final_answer_with_exception(self, final_answer_tool: FinalA... method _deserialize_final_answer (line 310) | def _deserialize_final_answer(encoded_value: str, allow_pickle: bool =... class E2BExecutor (line 338) | class E2BExecutor(RemotePythonExecutor): method __init__ (line 354) | def __init__( method run_code_raise_errors (line 377) | def run_code_raise_errors(self, code: str) -> CodeOutput: method cleanup (line 441) | def cleanup(self): function _websocket_send_execute_request (line 453) | def _websocket_send_execute_request(code: str, ws) -> str: function _websocket_run_code_raise_errors (line 484) | def _websocket_run_code_raise_errors( function _create_kernel_http (line 527) | def _create_kernel_http(crate_kernel_endpoint: str, logger, headers: Opt... class DockerExecutor (line 546) | class DockerExecutor(RemotePythonExecutor): method __init__ (line 567) | def __init__( method run_code_raise_errors (line 674) | def run_code_raise_errors(self, code: str) -> CodeOutput: method cleanup (line 689) | def cleanup(self): method delete (line 701) | def delete(self): method _wait_for_server (line 705) | def _wait_for_server(self, token: str): class ModalExecutor (line 721) | class ModalExecutor(RemotePythonExecutor): method __init__ (line 743) | def __init__( method run_code_raise_errors (line 808) | def run_code_raise_errors(self, code: str) -> CodeOutput: method cleanup (line 823) | def cleanup(self): method delete (line 828) | def delete(self): method _wait_for_server (line 832) | def _wait_for_server(self, host: str, token: str): method _strip_ansi_colors (line 849) | def _strip_ansi_colors(cls, text: str) -> str: class BlaxelExecutor (line 854) | class BlaxelExecutor(RemotePythonExecutor): method __init__ (line 877) | def __init__( method _create_sandbox (line 949) | def _create_sandbox(config): method run_code_raise_errors (line 958) | def run_code_raise_errors(self, code: str) -> CodeOutput: method install_packages (line 977) | def install_packages(self, additional_imports: list[str]) -> list[str]: method _delete_sandbox (line 1036) | def _delete_sandbox(self): method cleanup (line 1044) | def cleanup(self): method delete (line 1062) | def delete(self): method __del__ (line 1066) | def __del__(self): class WasmExecutor (line 1074) | class WasmExecutor(RemotePythonExecutor): method __init__ (line 1099) | def __init__( method _create_deno_runner (line 1160) | def _create_deno_runner(self): method _build_js_code (line 1174) | def _build_js_code(self) -> str: method _start_deno_server (line 1182) | def _start_deno_server(self): method run_code_raise_errors (line 1213) | def run_code_raise_errors(self, code: str) -> CodeOutput: method install_packages (line 1274) | def install_packages(self, additional_imports: list[str]) -> list[str]: method cleanup (line 1290) | def cleanup(self): method delete (line 1309) | def delete(self): FILE: src/smolagents/serialization.py class SerializationError (line 39) | class SerializationError(Exception): class SafeSerializer (line 45) | class SafeSerializer: method _get_optional_type (line 64) | def _get_optional_type(cls, module: str, attr: str): method to_json_safe (line 76) | def to_json_safe(obj: Any) -> Any: method from_json_safe (line 174) | def from_json_safe(obj: Any) -> Any: method dumps (line 252) | def dumps(obj: Any, allow_pickle: bool = False) -> str: method loads (line 295) | def loads(data: str, allow_pickle: bool = False) -> Any: method _extract_method_body (line 349) | def _extract_method_body(method) -> str: method get_safe_serializer_code (line 377) | def get_safe_serializer_code() -> str: method get_deserializer_code (line 452) | def get_deserializer_code(allow_pickle: bool) -> str: FILE: src/smolagents/tool_validation.py class MethodChecker (line 11) | class MethodChecker(ast.NodeVisitor): method __init__ (line 18) | def __init__(self, class_attributes: set[str], check_imports: bool = T... method visit_arguments (line 30) | def visit_arguments(self, node): method visit_Import (line 38) | def visit_Import(self, node): method visit_ImportFrom (line 43) | def visit_ImportFrom(self, node): method visit_Assign (line 49) | def visit_Assign(self, node): method visit_With (line 59) | def visit_With(self, node): method visit_ExceptHandler (line 67) | def visit_ExceptHandler(self, node): method visit_AnnAssign (line 73) | def visit_AnnAssign(self, node): method visit_For (line 80) | def visit_For(self, node): method _handle_comprehension_generators (line 90) | def _handle_comprehension_generators(self, generators): method visit_ListComp (line 100) | def visit_ListComp(self, node): method visit_DictComp (line 105) | def visit_DictComp(self, node): method visit_SetComp (line 110) | def visit_SetComp(self, node): method visit_Attribute (line 115) | def visit_Attribute(self, node): method visit_ClassDef (line 119) | def visit_ClassDef(self, node): method visit_Name (line 124) | def visit_Name(self, node): method visit_Call (line 140) | def visit_Call(self, node): function validate_tool_attributes (line 157) | def validate_tool_attributes(cls, check_imports: bool = True) -> None: FILE: src/smolagents/tools.py function validate_after_init (line 70) | def validate_after_init(cls): class BaseTool (line 98) | class BaseTool(ABC): method __call__ (line 102) | def __call__(self, *args, **kwargs) -> Any: class Tool (line 106) | class Tool(BaseTool): method __init__ (line 137) | def __init__(self, *args, **kwargs): method __init_subclass__ (line 140) | def __init_subclass__(cls, **kwargs): method validate_arguments (line 144) | def validate_arguments(self): method forward (line 228) | def forward(self, *args, **kwargs): method __call__ (line 231) | def __call__(self, *args, sanitize_inputs_outputs: bool = False, **kwa... method setup (line 251) | def setup(self): method to_code_prompt (line 258) | def to_code_prompt(self) -> str: method to_tool_calling_prompt (line 289) | def to_tool_calling_prompt(self) -> str: method to_dict (line 292) | def to_dict(self) -> dict: method from_dict (line 368) | def from_dict(cls, tool_dict: dict[str, Any], **kwargs) -> "Tool": method save (line 390) | def save(self, output_dir: str | Path, tool_file_name: str = "tool", m... method _write_file (line 417) | def _write_file(self, file_path: Path, content: str) -> None: method push_to_hub (line 421) | def push_to_hub( method _initialize_hub_repo (line 461) | def _initialize_hub_repo(repo_id: str, token: bool | str | None, priva... method _prepare_hub_files (line 474) | def _prepare_hub_files(self) -> list: method _get_tool_code (line 495) | def _get_tool_code(self) -> str: method _get_gradio_app_code (line 499) | def _get_gradio_app_code(self, tool_module_name: str = "tool") -> str: method _get_requirements (line 512) | def _get_requirements(self) -> str: method from_hub (line 517) | def from_hub( method from_code (line 572) | def from_code(cls, tool_code: str, **kwargs): method from_space (line 600) | def from_space( method from_gradio (line 742) | def from_gradio(gradio_tool): method from_langchain (line 763) | def from_langchain(langchain_tool): function launch_gradio_demo (line 794) | def launch_gradio_demo(tool: Tool): function load_tool (line 840) | def load_tool( function add_description (line 882) | def add_description(description): class ToolCollection (line 895) | class ToolCollection: method __init__ (line 906) | def __init__(self, tools: list[Tool]): method from_hub (line 910) | def from_hub( method from_mcp (line 951) | def from_mcp( function tool (line 1061) | def tool(tool_function: Callable) -> Tool: class PipelineTool (line 1171) | class PipelineTool(Tool): method __init__ (line 1219) | def __init__( method setup (line 1255) | def setup(self): method encode (line 1291) | def encode(self, raw_inputs): method forward (line 1297) | def forward(self, inputs): method decode (line 1306) | def decode(self, outputs): method __call__ (line 1312) | def __call__(self, *args, sanitize_inputs_outputs: bool = False, **kwa... function get_tools_definition_code (line 1335) | def get_tools_definition_code(tools: dict[str, Tool]) -> str: function validate_tool_arguments (line 1361) | def validate_tool_arguments(tool: Tool, arguments: Any) -> None: FILE: src/smolagents/utils.py function _is_package_available (line 45) | def _is_package_available(package_name: str) -> bool: function sanitize_for_rich (line 64) | def sanitize_for_rich(value) -> str: class AgentError (line 92) | class AgentError(Exception): method __init__ (line 95) | def __init__(self, message, logger: "AgentLogger"): method dict (line 100) | def dict(self) -> dict[str, str]: class AgentParsingError (line 104) | class AgentParsingError(AgentError): class AgentExecutionError (line 110) | class AgentExecutionError(AgentError): class AgentMaxStepsError (line 116) | class AgentMaxStepsError(AgentError): class AgentToolCallError (line 122) | class AgentToolCallError(AgentExecutionError): class AgentToolExecutionError (line 128) | class AgentToolExecutionError(AgentExecutionError): class AgentGenerationError (line 134) | class AgentGenerationError(AgentError): function make_json_serializable (line 140) | def make_json_serializable(obj: Any) -> Any: function parse_json_blob (line 166) | def parse_json_blob(json_blob: str) -> tuple[dict[str, str], str]: function extract_code_from_text (line 189) | def extract_code_from_text(text: str, code_block_tags: tuple[str, str]) ... function parse_code_blobs (line 198) | def parse_code_blobs(text: str, code_block_tags: tuple[str, str]) -> str: function truncate_content (line 257) | def truncate_content(content: str, max_length: int = MAX_LENGTH_TRUNCATE... class ImportFinder (line 268) | class ImportFinder(ast.NodeVisitor): method __init__ (line 269) | def __init__(self): method visit_Import (line 272) | def visit_Import(self, node): method visit_ImportFrom (line 278) | def visit_ImportFrom(self, node): function instance_to_source (line 285) | def instance_to_source(instance, base_cls=None): function get_source (line 376) | def get_source(obj) -> str: function encode_image_base64 (line 430) | def encode_image_base64(image): function make_image_url (line 436) | def make_image_url(base64_image): function make_init_file (line 440) | def make_init_file(folder: str | Path): function is_valid_name (line 447) | def is_valid_name(name: str) -> bool: function create_agent_gradio_app_template (line 490) | def create_agent_gradio_app_template(): class RateLimiter (line 497) | class RateLimiter: method __init__ (line 512) | def __init__(self, requests_per_minute: float | None = None): method throttle (line 517) | def throttle(self): class Retrying (line 528) | class Retrying: method __init__ (line 531) | def __init__( method __call__ (line 551) | def __call__(self, fn, *args: Any, **kwargs: Any) -> Any: FILE: src/smolagents/vision_web_browser.py function parse_arguments (line 27) | def parse_arguments(): function save_screenshot (line 66) | def save_screenshot(memory_step: ActionStep, agent: CodeAgent) -> None: function _escape_xpath_string (line 87) | def _escape_xpath_string(s: str) -> str: function search_item_ctrl_f (line 106) | def search_item_ctrl_f(text: str, nth_result: int = 1) -> str: function go_back (line 125) | def go_back() -> None: function close_popups (line 131) | def close_popups() -> str: function initialize_driver (line 138) | def initialize_driver(): function initialize_agent (line 148) | def initialize_agent(model): function run_webagent (line 217) | def run_webagent( function main (line 240) | def main() -> None: FILE: tests/conftest.py function patch_multi_step_agent_with_suppressed_logging (line 16) | def patch_multi_step_agent_with_suppressed_logging(): FILE: tests/fixtures/agents.py function get_agent_dict (line 134) | def get_agent_dict(): FILE: tests/fixtures/tools.py function test_tool (line 7) | def test_tool(): function no_input_tool (line 23) | def no_input_tool(): function single_input_tool (line 37) | def single_input_tool(): function multi_input_tool (line 51) | def multi_input_tool(): function multiline_description_tool (line 68) | def multiline_description_tool(): function example_tool (line 82) | def example_tool(): function boolean_default_tool_class (line 96) | def boolean_default_tool_class(): function boolean_default_tool_function (line 113) | def boolean_default_tool_function(): function optional_input_tool_class (line 129) | def optional_input_tool_class(): function optional_input_tool_function (line 148) | def optional_input_tool_function(): FILE: tests/test_agents.py class ChoiceDeltaToolCallFunction (line 81) | class ChoiceDeltaToolCallFunction: class ChoiceDeltaToolCall (line 87) | class ChoiceDeltaToolCall: class ChoiceDelta (line 95) | class ChoiceDelta: function get_new_path (line 103) | def get_new_path(suffix="") -> str: function agent_logger (line 109) | def agent_logger(): class FakeToolCallModel (line 115) | class FakeToolCallModel(Model): method generate (line 116) | def generate(self, messages, tools_to_call_from=None, stop_sequences=N... class FakeToolCallModelImage (line 145) | class FakeToolCallModelImage(Model): method generate (line 146) | def generate(self, messages, tools_to_call_from=None, stop_sequences=N... class FakeToolCallModelVL (line 176) | class FakeToolCallModelVL(Model): method generate (line 177) | def generate(self, messages, tools_to_call_from=None, stop_sequences=N... class FakeCodeModel (line 210) | class FakeCodeModel(Model): method generate (line 211) | def generate(self, messages, stop_sequences=None): class FakeCodeModelImageGeneration (line 235) | class FakeCodeModelImageGeneration(Model): method generate (line 236) | def generate(self, messages, stop_sequences=None): class FakeCodeModelPlanning (line 260) | class FakeCodeModelPlanning(Model): method generate (line 261) | def generate(self, messages, stop_sequences=None): class FakeCodeModelError (line 288) | class FakeCodeModelError(Model): method generate (line 289) | def generate(self, messages, stop_sequences=None): class FakeCodeModelSyntaxError (line 317) | class FakeCodeModelSyntaxError(Model): method generate (line 318) | def generate(self, messages, stop_sequences=None): class FakeCodeModelImport (line 345) | class FakeCodeModelImport(Model): method generate (line 346) | def generate(self, messages, stop_sequences=None): class FakeCodeModelFunctionDef (line 359) | class FakeCodeModelFunctionDef(Model): method generate (line 360) | def generate(self, messages, stop_sequences=None): class FakeCodeModelSingleStep (line 389) | class FakeCodeModelSingleStep(Model): method generate (line 390) | def generate(self, messages, stop_sequences=None): class FakeCodeModelNoReturn (line 403) | class FakeCodeModelNoReturn(Model): method generate (line 404) | def generate(self, messages, stop_sequences=None): class TestAgent (line 417) | class TestAgent: method test_fake_toolcalling_agent (line 418) | def test_fake_toolcalling_agent(self): method test_toolcalling_agent_handles_image_tool_outputs (line 427) | def test_toolcalling_agent_handles_image_tool_outputs(self, shared_dat... method test_toolcalling_agent_handles_image_inputs (line 447) | def test_toolcalling_agent_handles_image_inputs(self, shared_datadir): method test_fake_code_agent (line 466) | def test_fake_code_agent(self): method test_additional_args_added_to_task (line 476) | def test_additional_args_added_to_task(self): method test_reset_conversations (line 484) | def test_reset_conversations(self): method test_setup_agent_with_empty_toolbox (line 498) | def test_setup_agent_with_empty_toolbox(self): method test_fails_max_steps (line 501) | def test_fails_max_steps(self): method test_tool_descriptions_get_baked_in_system_prompt (line 522) | def test_tool_descriptions_get_baked_in_system_prompt(self): method test_module_imports_get_baked_in_system_prompt (line 532) | def test_module_imports_get_baked_in_system_prompt(self): method test_init_agent_with_different_toolsets (line 538) | def test_init_agent_with_different_toolsets(self): method test_function_persistence_across_steps (line 562) | def test_function_persistence_across_steps(self): method test_init_managed_agent (line 572) | def test_init_managed_agent(self): method test_agent_description_gets_correctly_inserted_in_system_prompt (line 577) | def test_agent_description_gets_correctly_inserted_in_system_prompt(se... method test_replay_shows_logs (line 590) | def test_replay_shows_logs(self, agent_logger): method test_code_nontrivial_final_answer_works (line 615) | def test_code_nontrivial_final_answer_works(self): method test_transformers_toolcalling_agent (line 633) | def test_transformers_toolcalling_agent(self): method test_final_answer_checks (line 664) | def test_final_answer_checks(self): method test_final_answer_checks_with_agent_access (line 686) | def test_final_answer_checks_with_agent_access(self): method test_generation_errors_are_raised (line 739) | def test_generation_errors_are_raised(self): method test_planning_step_with_injected_memory (line 750) | def test_planning_step_with_injected_memory(self): class CustomFinalAnswerTool (line 824) | class CustomFinalAnswerTool(FinalAnswerTool): method forward (line 825) | def forward(self, answer) -> str: class MockTool (line 829) | class MockTool(Tool): method __init__ (line 830) | def __init__(self, name): method forward (line 836) | def forward(self): class MockAgent (line 840) | class MockAgent: method __init__ (line 841) | def __init__(self, name, tools, description="Mock agent description"): class DummyMultiStepAgent (line 847) | class DummyMultiStepAgent(MultiStepAgent): method step (line 848) | def step(self, memory_step: ActionStep) -> Generator[None]: method initialize_system_prompt (line 851) | def initialize_system_prompt(self): class FakeLLMModel (line 855) | class FakeLLMModel(Model): method __init__ (line 856) | def __init__(self, give_token_usage: bool = True): method generate (line 859) | def generate(self, prompt, tools_to_call_from=None, **kwargs): class TestRunResult (line 885) | class TestRunResult: method test_backward_compatibility (line 886) | def test_backward_compatibility(self): method test_no_token_usage (line 927) | def test_no_token_usage(self, agent_class): method test_full_result (line 953) | def test_full_result(self, init_return_full_result, run_return_full_re... class TestMultiStepAgent (line 973) | class TestMultiStepAgent: method test_instantiation_disables_logging_to_terminal (line 974) | def test_instantiation_disables_logging_to_terminal(self): method test_instantiation_with_prompt_templates (line 979) | def test_instantiation_with_prompt_templates(self, prompt_templates): method test_instantiation_with_final_answer_tool (line 991) | def test_instantiation_with_final_answer_tool(self, tools, expected_fi... method test_system_prompt_property (line 996) | def test_system_prompt_property(self): method test_setup_step_callbacks (line 1090) | def test_setup_step_callbacks(self, step_callbacks, expected_registry_... method test_finalize_step_callbacks_with_list (line 1112) | def test_finalize_step_callbacks_with_list(self): method test_finalize_step_callbacks_by_type (line 1147) | def test_finalize_step_callbacks_by_type(self): method test_logs_display_thoughts_even_if_error (line 1218) | def test_logs_display_thoughts_even_if_error(self): method test_step_number (line 1245) | def test_step_number(self): method test_planning_step (line 1292) | def test_planning_step(self, step, expected_messages_list): method test_provide_final_answer (line 1387) | def test_provide_final_answer(self, expected_messages_list): method test_interrupt (line 1429) | def test_interrupt(self): method test_validate_tools_and_managed_agents (line 1486) | def test_validate_tools_and_managed_agents(self, tools, managed_agents... method test_from_dict (line 1496) | def test_from_dict(self): method test_multiagent_to_dict_from_dict_roundtrip (line 1546) | def test_multiagent_to_dict_from_dict_roundtrip(self): method test_from_dict_invalid_model_class (line 1597) | def test_from_dict_invalid_model_class(self): method test_from_dict_invalid_agent_class (line 1614) | def test_from_dict_invalid_agent_class(self): class TestToolCallingAgent (line 1645) | class TestToolCallingAgent: method test_toolcalling_agent_instructions (line 1646) | def test_toolcalling_agent_instructions(self): method test_toolcalling_agent_passes_both_tools_and_managed_agents (line 1651) | def test_toolcalling_agent_passes_both_tools_and_managed_agents(self, ... method test_toolcalling_agent_api (line 1679) | def test_toolcalling_agent_api(self, mock_inference_client): method test_toolcalling_agent_stream_logs_multiple_tool_calls_observations (line 1731) | def test_toolcalling_agent_stream_logs_multiple_tool_calls_observation... method test_toolcalling_agent_final_answer_cannot_be_called_with_parallel_tool_calls (line 1816) | def test_toolcalling_agent_final_answer_cannot_be_called_with_parallel... method test_toolcalling_agent_api_misformatted_output (line 1891) | def test_toolcalling_agent_api_misformatted_output(self, mock_inferenc... method test_change_tools_after_init (line 1920) | def test_change_tools_after_init(self): method test_custom_final_answer_with_custom_inputs (line 1945) | def test_custom_final_answer_with_custom_inputs(self, test_tool): method test_process_tool_calls (line 2065) | def test_process_tool_calls(self, test_case, test_tool): class TestCodeAgent (line 2092) | class TestCodeAgent: method test_code_agent_instructions (line 2093) | def test_code_agent_instructions(self): method test_call_with_provide_run_summary (line 2105) | def test_call_with_provide_run_summary(self, provide_run_summary): method test_code_agent_image_output (line 2123) | def test_code_agent_image_output(self): method test_errors_logging (line 2137) | def test_errors_logging(self): method test_missing_import_triggers_advice_in_error_log (line 2150) | def test_missing_import_triggers_advice_in_error_log(self): method test_errors_show_offending_line_and_error (line 2159) | def test_errors_show_offending_line_and_error(self): method test_error_saves_previous_print_outputs (line 2167) | def test_error_saves_previous_print_outputs(self): method test_syntax_error_show_offending_lines (line 2172) | def test_syntax_error_show_offending_lines(self): method test_end_code_appending (line 2184) | def test_end_code_appending(self): method test_change_tools_after_init (line 2212) | def test_change_tools_after_init(self): method test_local_python_executor_with_custom_functions (line 2237) | def test_local_python_executor_with_custom_functions(self): method test_from_folder (line 2251) | def test_from_folder(self, agent_dict_version, get_agent_dict): method test_from_dict (line 2284) | def test_from_dict(self): method test_custom_final_answer_with_custom_inputs (line 2346) | def test_custom_final_answer_with_custom_inputs(self): method test_use_structured_outputs_internally (line 2364) | def test_use_structured_outputs_internally(self): class TestMultiAgents (line 2381) | class TestMultiAgents: method test_multiagents_save (line 2382) | def test_multiagents_save(self, tmp_path): method test_multiagents (line 2445) | def test_multiagents(self): function prompt_templates (line 2574) | def prompt_templates(): function test_tool_calling_agents_raises_tool_call_error_being_invoked_with_wrong_arguments (line 2596) | def test_tool_calling_agents_raises_tool_call_error_being_invoked_with_w... function test_tool_calling_agents_raises_agent_execution_error_when_tool_raises (line 2613) | def test_tool_calling_agents_raises_agent_execution_error_when_tool_rais... FILE: tests/test_all_docs.py class SubprocessCallException (line 31) | class SubprocessCallException(Exception): function run_command (line 35) | def run_command(command: list[str], return_stdout=False, env=None): class DocCodeExtractor (line 59) | class DocCodeExtractor: method extract_python_code (line 63) | def extract_python_code(content: str) -> list[str]: method create_test_script (line 70) | def create_test_script(code_blocks: list[str], tmp_dir: str) -> Path: class TestDocs (line 84) | class TestDocs: method setup_class (line 88) | def setup_class(cls): method teardown_class (line 104) | def teardown_class(cls): method test_single_doc (line 108) | def test_single_doc(self, doc_path: Path): method _setup (line 157) | def _setup(self): function pytest_generate_tests (line 166) | def pytest_generate_tests(metafunc): FILE: tests/test_cli.py function set_env_vars (line 11) | def set_env_vars(monkeypatch): function test_load_model_openai_model (line 16) | def test_load_model_openai_model(set_env_vars): function test_load_model_litellm_model (line 26) | def test_load_model_litellm_model(): function test_load_model_transformers_model (line 34) | def test_load_model_transformers_model(): function test_load_model_hf_api_model (line 48) | def test_load_model_hf_api_model(set_env_vars): function test_load_model_invalid_model_type (line 57) | def test_load_model_invalid_model_type(): function test_cli_main (line 62) | def test_cli_main(capsys): function test_vision_web_browser_main (line 87) | def test_vision_web_browser_main(): FILE: tests/test_default_tools.py class DefaultToolTests (line 33) | class DefaultToolTests(unittest.TestCase): method test_visit_webpage (line 34) | def test_visit_webpage(self): method test_ddgs_with_kwargs (line 41) | def test_ddgs_with_kwargs(self): class TestPythonInterpreterTool (line 46) | class TestPythonInterpreterTool(ToolTesterMixin): method setup_method (line 47) | def setup_method(self): method test_exact_match_arg (line 51) | def test_exact_match_arg(self): method test_exact_match_kwarg (line 55) | def test_exact_match_kwarg(self): method test_agent_type_output (line 59) | def test_agent_type_output(self): method test_agent_types_inputs (line 65) | def test_agent_types_inputs(self): method test_imports_work (line 81) | def test_imports_work(self): method test_unauthorized_imports_fail (line 85) | def test_unauthorized_imports_fail(self): method test_custom_timeout (line 90) | def test_custom_timeout(self): method test_disabled_timeout (line 103) | def test_disabled_timeout(self): class TestSpeechToTextTool (line 118) | class TestSpeechToTextTool: method test_new_instance (line 119) | def test_new_instance(self): method test_initialization (line 127) | def test_initialization(self): function test_wikipedia_search (line 145) | def test_wikipedia_search(language, content_type, extract_format, query): FILE: tests/test_final_answer.py class TestFinalAnswerTool (line 28) | class TestFinalAnswerTool(ToolTesterMixin): method setup_method (line 29) | def setup_method(self): method test_exact_match_arg (line 33) | def test_exact_match_arg(self): method test_exact_match_kwarg (line 37) | def test_exact_match_kwarg(self): method test_agent_type_output (line 42) | def test_agent_type_output(self, inputs): method inputs (line 49) | def inputs(self, shared_datadir): FILE: tests/test_function_type_hints_utils.py function valid_func (line 23) | def valid_func(): function no_docstring_func (line 42) | def no_docstring_func(): function missing_arg_doc_func (line 52) | def missing_arg_doc_func(): function bad_return_func (line 68) | def bad_return_func(): function complex_types_func (line 84) | def complex_types_func(): function optional_types_func (line 103) | def optional_types_func(): function enum_choices_func (line 121) | def enum_choices_func(): function union_types_func (line 138) | def union_types_func(): function nested_types_func (line 155) | def nested_types_func(): function typed_docstring_func (line 172) | def typed_docstring_func(): function mismatched_types_func (line 190) | def mismatched_types_func(): function complex_docstring_types_func (line 207) | def complex_docstring_types_func(): function keywords_in_description_func (line 224) | def keywords_in_description_func(): class TestGetJsonSchema (line 240) | class TestGetJsonSchema: method test_get_json_schema_example (line 241) | def test_get_json_schema_example(self): method test_get_json_schema (line 282) | def test_get_json_schema(self, request, fixture_name, should_fail): method test_get_json_schema_raises (line 298) | def test_get_json_schema_raises(self, request, fixture_name, should_fa... method test_property_types (line 310) | def test_property_types(self, request, fixture_name, expected_properti... method test_schema_basic_structure (line 319) | def test_schema_basic_structure(self, valid_func): method test_complex_types (line 346) | def test_complex_types(self, complex_types_func): method test_optional_types (line 360) | def test_optional_types(self, optional_types_func): method test_enum_choices (line 372) | def test_enum_choices(self, enum_choices_func): method test_union_types (line 379) | def test_union_types(self, union_types_func): method test_nested_types (line 389) | def test_nested_types(self, nested_types_func): method test_typed_docstring_parsing (line 395) | def test_typed_docstring_parsing(self, typed_docstring_func): method test_mismatched_docstring_types (line 414) | def test_mismatched_docstring_types(self, mismatched_types_func): method test_complex_docstring_types (line 422) | def test_complex_docstring_types(self, complex_docstring_types_func): method test_type_in_description_handling (line 442) | def test_type_in_description_handling(self, request, fixture_name, exp... method test_with_special_words_in_description_func (line 450) | def test_with_special_words_in_description_func(self, keywords_in_desc... class TestGetCode (line 455) | class TestGetCode: method test_get_imports (line 513) | def test_get_imports(self, code: str, expected: list[str]): FILE: tests/test_gradio_ui.py class GradioUITester (line 31) | class GradioUITester(unittest.TestCase): method setUp (line 32) | def setUp(self): method tearDown (line 39) | def tearDown(self): method test_upload_file_default_types (line 43) | def test_upload_file_default_types(self): method test_upload_file_default_types_disallowed (line 57) | def test_upload_file_default_types_disallowed(self): method test_upload_file_success (line 70) | def test_upload_file_success(self): method test_upload_file_none (line 83) | def test_upload_file_none(self): method test_upload_file_invalid_type (line 90) | def test_upload_file_invalid_type(self): method test_upload_file_special_chars (line 101) | def test_upload_file_special_chars(self): method test_upload_file_custom_types (line 122) | def test_upload_file_custom_types(self): class TestStreamToGradio (line 134) | class TestStreamToGradio: method test_stream_to_gradio_memory_step (line 138) | def test_stream_to_gradio_memory_step(self, mock_pull_messages): method test_stream_to_gradio_stream_delta (line 153) | def test_stream_to_gradio_stream_delta(self): method test_stream_to_gradio_multiple_deltas (line 165) | def test_stream_to_gradio_multiple_deltas(self): method test_stream_to_gradio_parameters (line 188) | def test_stream_to_gradio_parameters(self, task, task_images, reset_me... class TestPullMessagesFromStep (line 209) | class TestPullMessagesFromStep: method test_action_step_basic (line 210) | def test_action_step_basic( method test_action_step_with_tool_calls (line 236) | def test_action_step_with_tool_calls(self): method test_action_step_tool_call_formats (line 258) | def test_action_step_tool_call_formats(self, tool_name, args, expected): method test_action_step_with_error (line 277) | def test_action_step_with_error(self): method test_action_step_with_images (line 290) | def test_action_step_with_images(self): method test_planning_step (line 309) | def test_planning_step(self, skip_model_outputs, expected_messages_len... method test_final_answer_step (line 339) | def test_final_answer_step(self, answer_type, answer_value, expected_c... method test_final_answer_step_image (line 353) | def test_final_answer_step_image(self): method test_final_answer_step_audio (line 362) | def test_final_answer_step_audio(self): method test_unsupported_step_type (line 371) | def test_unsupported_step_type(self): FILE: tests/test_import.py function test_import_smolagents_without_extras (line 6) | def test_import_smolagents_without_extras(monkeypatch): FILE: tests/test_local_python_executor.py function add_two (line 48) | def add_two(x): class TestEvaluatePythonCode (line 52) | class TestEvaluatePythonCode: method assertDictEqualNoPrint (line 53) | def assertDictEqualNoPrint(self, dict1, dict2): method test_evaluate_assign (line 58) | def test_evaluate_assign(self): method test_assignment_cannot_overwrite_tool (line 77) | def test_assignment_cannot_overwrite_tool(self): method test_subscript_call (line 83) | def test_subscript_call(self): method test_evaluate_call (line 91) | def test_evaluate_call(self): method test_evaluate_call_starred_kwargs (line 163) | def test_evaluate_call_starred_kwargs(self, code, expected_result): method test_evaluate_call_starred_kwargs_errors (line 203) | def test_evaluate_call_starred_kwargs_errors(self, code, expected_erro... method test_evaluate_class_def (line 209) | def test_evaluate_class_def(self): method test_evaluate_class_def_with_assign_attribute_target (line 228) | def test_evaluate_class_def_with_assign_attribute_target(self): method test_evaluate_constant (line 250) | def test_evaluate_constant(self): method test_evaluate_dict (line 257) | def test_evaluate_dict(self): method test_evaluate_expression (line 266) | def test_evaluate_expression(self): method test_evaluate_f_string (line 274) | def test_evaluate_f_string(self): method test_evaluate_f_string_with_format (line 282) | def test_evaluate_f_string_with_format(self): method test_evaluate_f_string_with_complex_format (line 291) | def test_evaluate_f_string_with_complex_format(self): method test_evaluate_if (line 307) | def test_evaluate_if(self): method test_evaluate_list (line 321) | def test_evaluate_list(self): method test_evaluate_name (line 328) | def test_evaluate_name(self): method test_evaluate_subscript (line 335) | def test_evaluate_subscript(self): method test_subscript_string_with_string_index_raises_appropriate_error (line 355) | def test_subscript_string_with_string_index_raises_appropriate_error(s... method test_evaluate_for (line 367) | def test_evaluate_for(self): method test_evaluate_binop (line 374) | def test_evaluate_binop(self): method test_recursive_function (line 381) | def test_recursive_function(self): method test_max_operations (line 392) | def test_max_operations(self): method test_operations_count (line 410) | def test_operations_count(self): method test_evaluate_string_methods (line 424) | def test_evaluate_string_methods(self): method test_evaluate_slicing (line 429) | def test_evaluate_slicing(self): method test_access_attributes (line 434) | def test_access_attributes(self): method test_list_comprehension (line 442) | def test_list_comprehension(self): method test_string_indexing (line 447) | def test_string_indexing(self): method test_tuples (line 460) | def test_tuples(self): method test_dictcomp (line 513) | def test_dictcomp(self): method test_dictcomp_nested (line 529) | def test_dictcomp_nested(self): method test_listcomp (line 540) | def test_listcomp(self): method test_listcomp_nested (line 545) | def test_listcomp_nested(self): method test_setcomp (line 556) | def test_setcomp(self): method test_setcomp_nested (line 561) | def test_setcomp_nested(self): method test_generatorexp (line 572) | def test_generatorexp(self): method test_generatorexp_with_infinite_sequence (line 579) | def test_generatorexp_with_infinite_sequence(self): method test_break (line 614) | def test_break(self): method test_pass (line 619) | def test_pass(self): method test_continue (line 624) | def test_continue(self): method test_call_int (line 633) | def test_call_int(self): method test_lambda (line 638) | def test_lambda(self): method test_tuple_assignment (line 643) | def test_tuple_assignment(self): method test_while (line 648) | def test_while(self): method test_generator (line 671) | def test_generator(self): method test_boolops (line 676) | def test_boolops(self): method test_if_conditions (line 713) | def test_if_conditions(self): method test_imports (line 721) | def test_imports(self): method test_additional_imports (line 765) | def test_additional_imports(self): method test_multiple_comparators (line 789) | def test_multiple_comparators(self): method test_print_output (line 806) | def test_print_output(self): method test_tuple_target_in_iterator (line 833) | def test_tuple_target_in_iterator(self): method test_classes (line 838) | def test_classes(self): method test_variable_args (line 920) | def test_variable_args(self): method test_exceptions (line 931) | def test_exceptions(self): method test_print (line 949) | def test_print(self): method test_types_as_objects (line 955) | def test_types_as_objects(self): method test_tuple_id (line 963) | def test_tuple_id(self): method test_nonsimple_augassign (line 972) | def test_nonsimple_augassign(self): method test_adding_int_to_list_raises_error (line 992) | def test_adding_int_to_list_raises_error(self): method test_error_highlights_correct_line_of_code (line 1000) | def test_error_highlights_correct_line_of_code(self): method test_error_type_returned_in_function_call (line 1011) | def test_error_type_returned_in_function_call(self): method test_assert (line 1021) | def test_assert(self): method test_with_context_manager (line 1030) | def test_with_context_manager(self): method test_with_context_manager_enter_returns_different_object (line 1054) | def test_with_context_manager_enter_returns_different_object(self): method test_with_context_manager_no_as_clause_exit_called (line 1079) | def test_with_context_manager_no_as_clause_exit_called(self): method test_with_exception_suppressed_by_exit (line 1101) | def test_with_exception_suppressed_by_exit(self): method test_with_exception_not_suppressed_by_exit (line 1121) | def test_with_exception_not_suppressed_by_exit(self): method test_with_multiple_cms_inner_suppresses_outer_sees_no_exception (line 1136) | def test_with_multiple_cms_inner_suppresses_outer_sees_no_exception(se... method test_with_multiple_cms_neither_suppresses (line 1161) | def test_with_multiple_cms_neither_suppresses(self): method test_with_multiple_cms_outer_suppresses (line 1180) | def test_with_multiple_cms_outer_suppresses(self): method test_with_exit_raising_replaces_original_exception (line 1205) | def test_with_exit_raising_replaces_original_exception(self): method test_default_arg_in_function (line 1219) | def test_default_arg_in_function(self): method test_set (line 1229) | def test_set(self): method test_return (line 1241) | def test_return(self): method test_nested_for_loop (line 1270) | def test_nested_for_loop(self): method test_pandas (line 1286) | def test_pandas(self): method test_starred (line 1337) | def test_starred(self): method test_for (line 1359) | def test_for(self): method test_syntax_error_points_error (line 1374) | def test_syntax_error_points_error(self): method test_close_matches_subscript (line 1381) | def test_close_matches_subscript(self): method test_dangerous_builtins_calls_are_blocked (line 1387) | def test_dangerous_builtins_calls_are_blocked(self): method test_final_answer_accepts_kwarg_answer (line 1401) | def test_final_answer_accepts_kwarg_answer(self): method test_final_answer_not_caught_by_except_exception (line 1406) | def test_final_answer_not_caught_by_except_exception(self): method test_dangerous_builtins_are_callable_if_explicitly_added (line 1424) | def test_dangerous_builtins_are_callable_if_explicitly_added(self): method test_can_import_os_if_explicitly_authorized (line 1433) | def test_can_import_os_if_explicitly_authorized(self): method test_can_import_os_if_all_imports_authorized (line 1437) | def test_can_import_os_if_all_imports_authorized(self): method test_can_import_scipy_if_explicitly_authorized (line 1442) | def test_can_import_scipy_if_explicitly_authorized(self): method test_can_import_sklearn_if_explicitly_authorized (line 1447) | def test_can_import_sklearn_if_explicitly_authorized(self): method test_function_def_recovers_source_code (line 1451) | def test_function_def_recovers_source_code(self): method test_evaluate_class_def_with_pass (line 1469) | def test_evaluate_class_def_with_pass(self): method test_evaluate_class_def_with_ann_assign_name (line 1482) | def test_evaluate_class_def_with_ann_assign_name(self): method test_evaluate_class_def_with_ann_assign_attribute (line 1512) | def test_evaluate_class_def_with_ann_assign_attribute(self): method test_evaluate_class_def_with_ann_assign_subscript (line 1538) | def test_evaluate_class_def_with_ann_assign_subscript(self): method test_evaluate_class_def_with_enum (line 1566) | def test_evaluate_class_def_with_enum(self): method test_evaluate_annassign (line 1598) | def test_evaluate_annassign(self): method test_evaluate_augassign (line 1661) | def test_evaluate_augassign(self, code, expected_result): method test_evaluate_augassign_number (line 1683) | def test_evaluate_augassign_number(self, operator, expected_result): method test_evaluate_augassign_custom (line 1709) | def test_evaluate_augassign_custom(self, operator, expected_result): method test_evaluate_delete (line 1775) | def test_evaluate_delete(self, code, expected_error_message): method test_non_standard_comparisons (line 1781) | def test_non_standard_comparisons(self): class TestEvaluateBoolop (line 1806) | class TestEvaluateBoolop: method test_evaluate_boolop_and (line 1810) | def test_evaluate_boolop_and(self, a, b, c): method test_evaluate_boolop_or (line 1819) | def test_evaluate_boolop_or(self, a, b, c): class TestEvaluateDelete (line 1826) | class TestEvaluateDelete: method test_evaluate_delete (line 1836) | def test_evaluate_delete(self, code, state, expectation): class TestEvaluateCondition (line 1848) | class TestEvaluateCondition: method test_evaluate_condition (line 1883) | def test_evaluate_condition(self, condition, state, expected_result): method test_evaluate_condition_with_pandas (line 1929) | def test_evaluate_condition_with_pandas(self, condition, state, expect... method test_evaluate_condition_with_pandas_exceptions (line 1965) | def test_evaluate_condition_with_pandas_exceptions(self, condition, st... class TestEvaluateSubscript (line 1972) | class TestEvaluateSubscript: method test_evaluate_subscript (line 2031) | def test_evaluate_subscript(self, subscript, state, expected_result): method test_evaluate_subscript_error (line 2052) | def test_evaluate_subscript_error(self, subscript, state, expected_err... method test_evaluate_subscript_with_custom_class (line 2065) | def test_evaluate_subscript_with_custom_class(self, subscriptable_clas... function test_get_safe_module_handle_lazy_imports (line 2088) | def test_get_safe_module_handle_lazy_imports(): class TestPrintContainer (line 2108) | class TestPrintContainer: method test_initial_value (line 2109) | def test_initial_value(self): method test_append (line 2113) | def test_append(self): method test_iadd (line 2118) | def test_iadd(self): method test_str (line 2123) | def test_str(self): method test_repr (line 2128) | def test_repr(self): method test_len (line 2133) | def test_len(self): function test_fix_final_answer_code (line 2139) | def test_fix_final_answer_code(): class TestTimeout (line 2177) | class TestTimeout: method test_timeout_decorator_completes_within_limit (line 2180) | def test_timeout_decorator_completes_within_limit(self): method test_timeout_decorator_raises_error_when_exceeded (line 2190) | def test_timeout_decorator_raises_error_when_exceeded(self): method test_evaluate_python_code_with_timeout_completes (line 2201) | def test_evaluate_python_code_with_timeout_completes(self): method test_evaluate_python_code_with_timeout_raises (line 2207) | def test_evaluate_python_code_with_timeout_raises(self): method test_timeout_works_in_thread (line 2218) | def test_timeout_works_in_thread(self): method test_custom_timeout_value (line 2256) | def test_custom_timeout_value(self): method test_longer_timeout_value (line 2266) | def test_longer_timeout_value(self): method test_disabled_timeout (line 2277) | def test_disabled_timeout(self): method test_local_executor_custom_timeout (line 2289) | def test_local_executor_custom_timeout(self): method test_local_executor_disabled_timeout (line 2302) | def test_local_executor_disabled_timeout(self): function test_check_import_authorized (line 2330) | def test_check_import_authorized(module: str, authorized_imports: list[s... class TestLocalPythonExecutor (line 2334) | class TestLocalPythonExecutor: method test_additional_authorized_imports_are_installed (line 2350) | def test_additional_authorized_imports_are_installed(self, additional_... method test_state_name (line 2359) | def test_state_name(self): method test_call_from_dict (line 2370) | def test_call_from_dict(self, code): method test_chained_assignments (line 2401) | def test_chained_assignments(self, code): method test_evaluate_assign_error (line 2407) | def test_evaluate_assign_error(self): method test_function_def_recovers_source_code (line 2413) | def test_function_def_recovers_source_code(self): method test_isinstance_builtin_type (line 2433) | def test_isinstance_builtin_type(self, code, expected_result): class TestLocalPythonExecutorSecurity (line 2440) | class TestLocalPythonExecutorSecurity: method test_vulnerability_import (line 2445) | def test_vulnerability_import(self, additional_authorized_imports, exp... method test_vulnerability_builtins (line 2458) | def test_vulnerability_builtins(self, additional_authorized_imports, e... method test_vulnerability_builtins_safe_functions (line 2471) | def test_vulnerability_builtins_safe_functions(self, additional_author... method test_vulnerability_builtins_dangerous_functions (line 2488) | def test_vulnerability_builtins_dangerous_functions( method test_vulnerability_dangerous_functions (line 2511) | def test_vulnerability_dangerous_functions(self, additional_authorized... method test_vulnerability_for_all_dangerous_functions (line 2525) | def test_vulnerability_for_all_dangerous_functions(self, dangerous_fun... method test_vulnerability_via_sys (line 2545) | def test_vulnerability_via_sys(self, additional_authorized_imports, ex... method test_vulnerability_via_sys_for_all_dangerous_modules (line 2562) | def test_vulnerability_via_sys_for_all_dangerous_modules(self, dangero... method test_vulnerability_via_importlib (line 2583) | def test_vulnerability_via_importlib(self, additional_authorized_impor... method test_vulnerability_via_submodules (line 2661) | def test_vulnerability_via_submodules(self, code, additional_authorize... method test_vulnerability_via_submodules_through_indirect_attribute_access (line 2710) | def test_vulnerability_via_submodules_through_indirect_attribute_access( method test_vulnerability_builtins_via_sys (line 2733) | def test_vulnerability_builtins_via_sys(self, additional_authorized_im... method test_vulnerability_builtins_via_traceback (line 2768) | def test_vulnerability_builtins_via_traceback( method test_vulnerability_builtins_via_class_catch_warnings (line 2816) | def test_vulnerability_builtins_via_class_catch_warnings( method test_vulnerability_load_module_via_builtin_importer (line 2856) | def test_vulnerability_load_module_via_builtin_importer(self, addition... method test_vulnerability_class_via_subclasses (line 2876) | def test_vulnerability_class_via_subclasses(self): method test_vulnerability_via_dunder_access (line 2904) | def test_vulnerability_via_dunder_access(self, code, dunder_attribute): method test_vulnerability_via_dunder_indirect_access (line 2909) | def test_vulnerability_via_dunder_indirect_access(self): method test_vulnerability_via_dunder_call (line 2970) | def test_vulnerability_via_dunder_call( FILE: tests/test_mcp_client.py function echo_server_script (line 11) | def echo_server_script(): function structured_output_server_script (line 29) | def structured_output_server_script(): function test_mcp_client_with_syntax (line 55) | def test_mcp_client_with_syntax(echo_server_script: str): function test_mcp_client_with_structured_output (line 64) | def test_mcp_client_with_structured_output(structured_output_server_scri... function test_mcp_client_without_structured_output (line 87) | def test_mcp_client_without_structured_output(structured_output_server_s... function test_mcp_client_try_finally_syntax (line 105) | def test_mcp_client_try_finally_syntax(echo_server_script: str): function test_multiple_servers (line 120) | def test_multiple_servers(echo_server_script: str): FILE: tests/test_memory.py class TestAgentMemory (line 20) | class TestAgentMemory: method test_initialization (line 21) | def test_initialization(self): method test_return_all_code_actions (line 27) | def test_return_all_code_actions(self): class TestMemoryStep (line 37) | class TestMemoryStep: method test_initialization (line 38) | def test_initialization(self): method test_dict (line 42) | def test_dict(self): method test_to_messages (line 46) | def test_to_messages(self): function test_action_step_dict (line 52) | def test_action_step_dict(): function test_action_step_to_messages (line 119) | def test_action_step_to_messages(): function test_action_step_to_messages_no_tool_calls_with_observations (line 159) | def test_action_step_to_messages_no_tool_calls_with_observations(): function test_planning_step_to_messages (line 180) | def test_planning_step_to_messages(): function test_task_step_to_messages (line 201) | def test_task_step_to_messages(): function test_system_prompt_step_to_messages (line 220) | def test_system_prompt_step_to_messages(): function test_memory_step_json_serialization (line 235) | def test_memory_step_json_serialization(): FILE: tests/test_models.py class TestModel (line 49) | class TestModel: method test_prepare_completion_kwargs_parameter_precedence (line 50) | def test_prepare_completion_kwargs_parameter_precedence(self): method test_agglomerate_stream_deltas (line 80) | def test_agglomerate_stream_deltas(self): method test_prepare_completion_kwargs_stop_sequences (line 154) | def test_prepare_completion_kwargs_stop_sequences(self, model_id, stop... method test_prepare_completion_kwargs_tool_choice (line 194) | def test_prepare_completion_kwargs_tool_choice(self, with_tools, tool_... method test_get_json_schema_has_nullable_args (line 210) | def test_get_json_schema_has_nullable_args(self): method test_chatmessage_has_model_dumps_json (line 225) | def test_chatmessage_has_model_dumps_json(self): method test_chatmessage_from_dict_role_conversion (line 230) | def test_chatmessage_from_dict_role_conversion(self): method test_get_mlx_message_no_tool (line 247) | def test_get_mlx_message_no_tool(self): method test_get_mlx_message_tricky_stop_sequence (line 254) | def test_get_mlx_message_tricky_stop_sequence(self): method test_transformers_message_no_tool (line 268) | def test_transformers_message_no_tool(self, monkeypatch): method test_transformers_message_vl_no_tool (line 286) | def test_transformers_message_vl_no_tool(self, shared_datadir, monkeyp... method test_parse_json_if_needed (line 312) | def test_parse_json_if_needed(self): class TestInferenceClientModel (line 330) | class TestInferenceClientModel: method test_call_with_custom_role_conversions (line 331) | def test_call_with_custom_role_conversions(self): method test_init_model_with_tokens (line 344) | def test_init_model_with_tokens(self): method test_structured_outputs_with_unsupported_provider (line 354) | def test_structured_outputs_with_unsupported_provider(self): method test_get_hfapi_message_no_tool (line 365) | def test_get_hfapi_message_no_tool(self): method test_get_hfapi_message_no_tool_external_provider (line 371) | def test_get_hfapi_message_no_tool_external_provider(self): method test_get_hfapi_message_stream_no_tool (line 377) | def test_get_hfapi_message_stream_no_tool(self): method test_get_hfapi_message_stream_no_tool_external_provider (line 384) | def test_get_hfapi_message_stream_no_tool_external_provider(self): class TestLiteLLMModel (line 391) | class TestLiteLLMModel: method test_call_different_providers_without_key (line 400) | def test_call_different_providers_without_key(self, model_id): method test_retry_on_rate_limit_error (line 429) | def test_retry_on_rate_limit_error(self): method test_passing_flatten_messages (line 477) | def test_passing_flatten_messages(self): class TestLiteLLMRouterModel (line 485) | class TestLiteLLMRouterModel: method test_flatten_messages_as_text (line 494) | def test_flatten_messages_as_text(self, model_id, expected): method test_create_client (line 503) | def test_create_client(self): class TestOpenAIModel (line 520) | class TestOpenAIModel: method test_client_kwargs_passed_correctly (line 521) | def test_client_kwargs_passed_correctly(self): method test_streaming_tool_calls (line 544) | def test_streaming_tool_calls(self): method test_stop_sequence_cutting_for_o4_mini (line 567) | def test_stop_sequence_cutting_for_o4_mini(self): class TestAmazonBedrockModel (line 593) | class TestAmazonBedrockModel: method test_client_for_bedrock (line 594) | def test_client_for_bedrock(self): class TestAzureOpenAIModel (line 605) | class TestAzureOpenAIModel: method test_client_kwargs_passed_correctly (line 606) | def test_client_kwargs_passed_correctly(self): class TestTransformersModel (line 638) | class TestTransformersModel: method test_init (line 656) | def test_init(self, patching): function test_get_clean_message_list_basic (line 685) | def test_get_clean_message_list_basic(): function test_get_clean_message_list_with_dicts (line 718) | def test_get_clean_message_list_with_dicts(messages, expected_roles, exp... function test_get_clean_message_list_role_conversions (line 726) | def test_get_clean_message_list_role_conversions(): function test_remove_content_after_stop_sequences (line 739) | def test_remove_content_after_stop_sequences(): function test_remove_content_after_stop_sequences_handles_none (line 746) | def test_remove_content_after_stop_sequences_handles_none(): function test_get_clean_message_list_image_encoding (line 782) | def test_get_clean_message_list_image_encoding(convert_images_to_image_u... function test_get_clean_message_list_flatten_messages_as_text (line 796) | def test_get_clean_message_list_flatten_messages_as_text(): function test_flatten_messages_as_text_for_all_models (line 843) | def test_flatten_messages_as_text_for_all_models( function test_supports_stop_parameter (line 910) | def test_supports_stop_parameter(model_id, expected): class TestGetToolCallFromText (line 915) | class TestGetToolCallFromText: method mock_uuid4 (line 917) | def mock_uuid4(self): method test_get_tool_call_from_text_basic (line 921) | def test_get_tool_call_from_text_basic(self): method test_get_tool_call_from_text_name_key_missing (line 930) | def test_get_tool_call_from_text_name_key_missing(self): method test_get_tool_call_from_text_json_object_args (line 938) | def test_get_tool_call_from_text_json_object_args(self): method test_get_tool_call_from_text_json_string_args (line 943) | def test_get_tool_call_from_text_json_string_args(self): method test_get_tool_call_from_text_missing_args (line 948) | def test_get_tool_call_from_text_missing_args(self): method test_get_tool_call_from_text_custom_keys (line 953) | def test_get_tool_call_from_text_custom_keys(self): method test_get_tool_call_from_text_numeric_args (line 959) | def test_get_tool_call_from_text_numeric_args(self): function test_tool_calls_json_serialization (line 973) | def test_tool_calls_json_serialization(model_class, model_id): FILE: tests/test_monitoring.py class FakeLLMModel (line 38) | class FakeLLMModel(Model): method generate (line 39) | def generate(self, prompt, tools_to_call_from=None, **kwargs): class MonitoringTester (line 65) | class MonitoringTester(unittest.TestCase): method test_code_agent_metrics_max_steps (line 66) | def test_code_agent_metrics_max_steps(self): method test_code_agent_metrics_generation_error (line 86) | def test_code_agent_metrics_generation_error(self): method test_streaming_agent_text_output (line 100) | def test_streaming_agent_text_output(self): method test_streaming_agent_image_output (line 119) | def test_streaming_agent_image_output(self): method test_streaming_with_agent_error (line 156) | def test_streaming_with_agent_error(self): function test_code_agent_metrics (line 177) | def test_code_agent_metrics(agent_class): class ReplayTester (line 189) | class ReplayTester(unittest.TestCase): method test_replay_with_chatmessage (line 190) | def test_replay_with_chatmessage(self): class AgentLoggerLogTaskTester (line 204) | class AgentLoggerLogTaskTester(unittest.TestCase): method test_logger_log_task_does_not_crash_on_stray_markup_or_control_chars (line 205) | def test_logger_log_task_does_not_crash_on_stray_markup_or_control_cha... method test_logger_log_task_accepts_non_string_payloads (line 228) | def test_logger_log_task_accepts_non_string_payloads(self): FILE: tests/test_remote_executors.py class TestRemotePythonExecutor (line 28) | class TestRemotePythonExecutor: method test_send_tools_empty_tools (line 29) | def test_send_tools_empty_tools(self): method test_send_variables_with_empty_dict_is_noop (line 37) | def test_send_variables_with_empty_dict_is_noop(self): method test_send_variables_non_empty_generates_executable_deserializer_code (line 43) | def test_send_variables_non_empty_generates_executable_deserializer_co... method test_send_variables_allow_pickle_handles_prefixed_payload (line 62) | def test_send_variables_allow_pickle_handles_prefixed_payload(self): method test_deserialize_final_answer_rejects_unprefixed_payload (line 76) | def test_deserialize_final_answer_rejects_unprefixed_payload(self): method test_send_tools_with_default_wikipedia_search_tool (line 81) | def test_send_tools_with_default_wikipedia_search_tool(self): class TestE2BExecutorUnit (line 91) | class TestE2BExecutorUnit: method test_e2b_executor_instantiation (line 92) | def test_e2b_executor_instantiation(self): method test_cleanup (line 120) | def test_cleanup(self): function e2b_executor (line 144) | def e2b_executor(): class TestE2BExecutorIntegration (line 154) | class TestE2BExecutorIntegration: method set_executor (line 156) | def set_executor(self, e2b_executor): method test_final_answer_patterns (line 191) | def test_final_answer_patterns(self, code_action, expected_result): method test_custom_final_answer (line 197) | def test_custom_final_answer(self): method test_custom_final_answer_with_custom_inputs (line 210) | def test_custom_final_answer_with_custom_inputs(self): class TestDockerExecutorUnit (line 232) | class TestDockerExecutorUnit: method test_cleanup (line 233) | def test_cleanup(self): class CommonDockerExecutorIntegration (line 265) | class CommonDockerExecutorIntegration: method set_executor (line 267) | def set_executor(self, custom_executor): method test_state_persistence (line 270) | def test_state_persistence(self): method test_execute_output (line 279) | def test_execute_output(self): method test_execute_multiline_output (line 286) | def test_execute_multiline_output(self): method test_execute_image_output (line 293) | def test_execute_image_output(self): method test_syntax_error_handling (line 306) | def test_syntax_error_handling(self): method test_final_answer_patterns (line 345) | def test_final_answer_patterns(self, code_action, expected_result): method test_custom_final_answer (line 351) | def test_custom_final_answer(self): method test_custom_final_answer_with_custom_inputs (line 364) | def test_custom_final_answer_with_custom_inputs(self): class TestDockerExecutorIntegration (line 387) | class TestDockerExecutorIntegration(CommonDockerExecutorIntegration): method custom_executor (line 389) | def custom_executor(self): method test_initialization (line 397) | def test_initialization(self): method test_cleanup_on_deletion (line 401) | def test_cleanup_on_deletion(self): class TestModalExecutorIntegration (line 412) | class TestModalExecutorIntegration(CommonDockerExecutorIntegration): method custom_executor (line 414) | def custom_executor(self): class TestModalExecutorUnit (line 423) | class TestModalExecutorUnit: method test_sandbox_lifecycle (line 430) | def test_sandbox_lifecycle( class TestWasmExecutorUnit (line 478) | class TestWasmExecutorUnit: method test_wasm_executor_instantiation (line 479) | def test_wasm_executor_instantiation(self): class TestWasmExecutorIntegration (line 528) | class TestWasmExecutorIntegration: method setup_and_teardown (line 537) | def setup_and_teardown(self): method test_basic_execution (line 557) | def test_basic_execution(self): method test_state_persistence (line 563) | def test_state_persistence(self): method test_final_answer (line 572) | def test_final_answer(self): method test_numpy_execution (line 580) | def test_numpy_execution(self): method test_error_handling (line 590) | def test_error_handling(self): method test_syntax_error_handling (line 597) | def test_syntax_error_handling(self): class TestBlaxelExecutorUnit (line 605) | class TestBlaxelExecutorUnit: method test_blaxel_executor_instantiation_without_blaxel_sdk (line 606) | def test_blaxel_executor_instantiation_without_blaxel_sdk(self): method test_blaxel_executor_instantiation_with_blaxel_sdk (line 617) | def test_blaxel_executor_instantiation_with_blaxel_sdk( method test_blaxel_executor_custom_parameters (line 659) | def test_blaxel_executor_custom_parameters( method test_blaxel_executor_cleanup (line 706) | def test_blaxel_executor_cleanup(self, mock_settings, mock_sandbox_ins... FILE: tests/test_search.py class TestDuckDuckGoSearchTool (line 23) | class TestDuckDuckGoSearchTool(ToolTesterMixin): method setup_method (line 24) | def setup_method(self): method test_exact_match_arg (line 29) | def test_exact_match_arg(self): method test_agent_type_output (line 34) | def test_agent_type_output(self): FILE: tests/test_serialization.py class PicklableCustomClass (line 37) | class PicklableCustomClass: method __init__ (line 40) | def __init__(self): class TestSafeSerializationSecurity (line 44) | class TestSafeSerializationSecurity: method test_safe_mode_blocks_custom_classes (line 47) | def test_safe_mode_blocks_custom_classes(self): method test_safe_mode_blocks_pickle_deserialization (line 60) | def test_safe_mode_blocks_pickle_deserialization(self): method test_pickle_fallback_with_warning (line 70) | def test_pickle_fallback_with_warning(self): class TestSafeSerializationRoundtrip (line 95) | class TestSafeSerializationRoundtrip: method test_primitives (line 98) | def test_primitives(self): method test_collections (line 117) | def test_collections(self): method test_datetime_types (line 132) | def test_datetime_types(self): method test_special_types (line 147) | def test_special_types(self): method test_complex_nested_structure (line 159) | def test_complex_nested_structure(self): class TestBackwardCompatibility (line 185) | class TestBackwardCompatibility: method test_read_legacy_pickle_data (line 188) | def test_read_legacy_pickle_data(self): method test_safe_data_is_preferred (line 204) | def test_safe_data_is_preferred(self): class TestDefaultBehavior (line 219) | class TestDefaultBehavior: method test_dumps_defaults_to_safe (line 222) | def test_dumps_defaults_to_safe(self): method test_loads_defaults_to_safe (line 234) | def test_loads_defaults_to_safe(self): class TestEdgeCases (line 252) | class TestEdgeCases: method test_empty_data (line 255) | def test_empty_data(self): method test_nested_empty_structures (line 272) | def test_nested_empty_structures(self): method test_very_large_numbers (line 288) | def test_very_large_numbers(self): method test_special_float_values (line 302) | def test_special_float_values(self): method test_unicode_strings (line 323) | def test_unicode_strings(self): method test_very_long_strings (line 338) | def test_very_long_strings(self): method test_deeply_nested_structures (line 346) | def test_deeply_nested_structures(self): method test_dict_with_tuple_keys (line 359) | def test_dict_with_tuple_keys(self): method test_dict_with_integer_keys (line 371) | def test_dict_with_integer_keys(self): method test_mixed_collection_types (line 383) | def test_mixed_collection_types(self): class TestErrorHandling (line 406) | class TestErrorHandling: method test_invalid_json_data (line 409) | def test_invalid_json_data(self): method test_corrupted_safe_prefix (line 414) | def test_corrupted_safe_prefix(self): method test_missing_type_field (line 419) | def test_missing_type_field(self): method test_unknown_type_marker (line 428) | def test_unknown_type_marker(self): method test_invalid_base64_in_bytes (line 436) | def test_invalid_base64_in_bytes(self): method test_serialization_of_none_type (line 443) | def test_serialization_of_none_type(self): method test_serialization_of_function (line 450) | def test_serialization_of_function(self): method test_serialization_of_class (line 459) | def test_serialization_of_class(self): method test_serialization_of_module (line 468) | def test_serialization_of_module(self): class TestTypeCoverage (line 476) | class TestTypeCoverage: method test_all_datetime_types (line 479) | def test_all_datetime_types(self): method test_decimal_precision (line 499) | def test_decimal_precision(self): method test_pathlib_types (line 518) | def test_pathlib_types(self): method test_complex_numbers (line 535) | def test_complex_numbers(self): method test_bytes_types (line 551) | def test_bytes_types(self): class TestNumpySupport (line 567) | class TestNumpySupport: method test_numpy_array (line 570) | def test_numpy_array(self): method test_numpy_scalars (line 583) | def test_numpy_scalars(self): method test_numpy_various_dtypes (line 598) | def test_numpy_various_dtypes(self): method test_numpy_multidimensional (line 630) | def test_numpy_multidimensional(self): method test_numpy_empty_array (line 647) | def test_numpy_empty_array(self): class TestPILSupport (line 658) | class TestPILSupport: method test_pil_image (line 661) | def test_pil_image(self): method test_pil_various_modes (line 676) | def test_pil_various_modes(self): method test_pil_various_sizes (line 692) | def test_pil_various_sizes(self): class TestDataclasses (line 707) | class TestDataclasses: method test_simple_dataclass (line 710) | def test_simple_dataclass(self): method test_nested_dataclass (line 728) | def test_nested_dataclass(self): class TestPerformance (line 750) | class TestPerformance: method test_large_list (line 753) | def test_large_list(self): method test_large_dict (line 762) | def test_large_dict(self): method test_deeply_nested_performance (line 771) | def test_deeply_nested_performance(self): class TestPrefixHandling (line 785) | class TestPrefixHandling: method test_safe_prefix_detection (line 788) | def test_safe_prefix_detection(self): method test_pickle_prefix_with_allow_pickle (line 797) | def test_pickle_prefix_with_allow_pickle(self): method test_legacy_format_detection (line 809) | def test_legacy_format_detection(self): class TestRealWorldScenarios (line 820) | class TestRealWorldScenarios: method test_agent_variables_scenario (line 823) | def test_agent_variables_scenario(self): method test_final_answer_scenario (line 851) | def test_final_answer_scenario(self): class TestGeneratedDeserializerCode (line 868) | class TestGeneratedDeserializerCode: method test_generated_deserializer_executes_for_safe_payload (line 871) | def test_generated_deserializer_executes_for_safe_payload(self): method test_generated_deserializer_handles_pickle_prefix_when_enabled (line 887) | def test_generated_deserializer_handles_pickle_prefix_when_enabled(self): class TestConcurrency (line 897) | class TestConcurrency: method test_concurrent_serialization (line 900) | def test_concurrent_serialization(self): FILE: tests/test_telemetry.py function in_memory_span_exporter (line 42) | def in_memory_span_exporter() -> InMemorySpanExporter: function tracer_provider (line 47) | def tracer_provider(in_memory_span_exporter: InMemorySpanExporter) -> tr... function instrument (line 56) | def instrument( class TestOpenTelemetry (line 67) | class TestOpenTelemetry: method test_model (line 68) | def test_model(self, in_memory_span_exporter: InMemorySpanExporter): FILE: tests/test_tool_validation.py function test_validate_tool_attributes_with_default_tools (line 23) | def test_validate_tool_attributes_with_default_tools(tool_class): class ValidTool (line 27) | class ValidTool(Tool): method __init__ (line 35) | def __init__(self, optional_param="default"): method forward (line 39) | def forward(self, input: str) -> str: function valid_tool_function (line 44) | def valid_tool_function(input: str) -> str: function test_validate_tool_attributes_valid (line 54) | def test_validate_tool_attributes_valid(tool_class): class InvalidToolName (line 58) | class InvalidToolName(Tool): method __init__ (line 64) | def __init__(self): method forward (line 67) | def forward(self, input: str) -> str: class InvalidToolComplexAttrs (line 71) | class InvalidToolComplexAttrs(Tool): method __init__ (line 78) | def __init__(self): method forward (line 81) | def forward(self, input: str) -> str: class InvalidToolRequiredParams (line 85) | class InvalidToolRequiredParams(Tool): method __init__ (line 91) | def __init__(self, required_param, kwarg1=1): # No default value method forward (line 95) | def forward(self, input: str) -> str: class InvalidToolNonLiteralDefaultParam (line 99) | class InvalidToolNonLiteralDefaultParam(Tool): method __init__ (line 105) | def __init__(self, default_param=UNDEFINED_VARIABLE): # UNDEFINED_VAR... method forward (line 109) | def forward(self, input: str) -> str: class InvalidToolUndefinedNames (line 113) | class InvalidToolUndefinedNames(Tool): method forward (line 119) | def forward(self, input: str) -> str: function test_validate_tool_attributes_exceptions (line 139) | def test_validate_tool_attributes_exceptions(tool_class, expected_error): class MultipleAssignmentsTool (line 144) | class MultipleAssignmentsTool(Tool): method __init__ (line 150) | def __init__(self): method forward (line 153) | def forward(self, input: str) -> str: function test_validate_tool_attributes_multiple_assignments (line 158) | def test_validate_tool_attributes_multiple_assignments(): function tool_function_with_multiple_assignments (line 163) | def tool_function_with_multiple_assignments(input: str) -> str: function test_tool_to_dict_validation_with_multiple_assignments (line 174) | def test_tool_to_dict_validation_with_multiple_assignments(tool_instance): class TestMethodChecker (line 178) | class TestMethodChecker: method test_multiple_assignments (line 179) | def test_multiple_assignments(self): FILE: tests/test_tools.py class ToolTesterMixin (line 33) | class ToolTesterMixin: method test_inputs_output (line 34) | def test_inputs_output(self): method test_common_attributes (line 50) | def test_common_attributes(self): method test_agent_type_output (line 56) | def test_agent_type_output(self, create_inputs): method create_inputs (line 64) | def create_inputs(self, shared_datadir): class TestTool (line 85) | class TestTool: method test_tool_input_type_validation (line 99) | def test_tool_input_type_validation(self, type_value, should_raise_err... method test_tool_to_code_prompt_output_format (line 144) | def test_tool_to_code_prompt_output_format(self, tool_fixture, expecte... method test_tool_to_tool_calling_prompt_output_format (line 171) | def test_tool_to_tool_calling_prompt_output_format(self, tool_fixture,... method test_tool_init_with_decorator (line 177) | def test_tool_init_with_decorator(self): method test_tool_init_vanilla (line 190) | def test_tool_init_vanilla(self): method test_tool_init_decorator_raises_issues (line 211) | def test_tool_init_decorator_raises_issues(self): method test_saving_tool_raises_error_imports_outside_function (line 241) | def test_saving_tool_raises_error_imports_outside_function(self, tmp_p... method test_tool_definition_raises_no_error_imports_in_function (line 273) | def test_tool_definition_raises_no_error_imports_in_function(self): method test_tool_to_dict_allows_no_arg_in_init (line 294) | def test_tool_to_dict_allows_no_arg_in_init(self): method test_saving_tool_allows_no_imports_from_outside_methods (line 331) | def test_saving_tool_allows_no_imports_from_outside_methods(self, tmp_... method test_tool_missing_class_attributes_raises_error (line 372) | def test_tool_missing_class_attributes_raises_error(self): method test_tool_from_decorator_optional_args (line 392) | def test_tool_from_decorator_optional_args(self): method test_tool_mismatching_nullable_args_raises_error (line 409) | def test_tool_mismatching_nullable_args_raises_error(self): method test_tool_default_parameters_is_nullable (line 471) | def test_tool_default_parameters_is_nullable(self): method test_tool_supports_any_none (line 485) | def test_tool_supports_any_none(self, tmp_path): method test_tool_supports_array (line 500) | def test_tool_supports_array(self): method test_tool_supports_string_literal (line 515) | def test_tool_supports_string_literal(self): method test_tool_supports_numeric_literal (line 529) | def test_tool_supports_numeric_literal(self): method test_tool_supports_nullable_literal (line 543) | def test_tool_supports_nullable_literal(self): method test_saving_tool_produces_valid_pyhon_code_with_multiline_description (line 558) | def test_saving_tool_produces_valid_pyhon_code_with_multiline_descript... method test_to_dict_boolean_default_input (line 576) | def test_to_dict_boolean_default_input(self, fixture_name, request): method test_to_dict_optional_input (line 586) | def test_to_dict_optional_input(self, fixture_name, request): method test_from_dict_roundtrip (line 595) | def test_from_dict_roundtrip(self, example_tool): method test_tool_from_dict_invalid (line 609) | def test_tool_from_dict_invalid(self): method test_tool_decorator_preserves_original_function (line 615) | def test_tool_decorator_preserves_original_function(self): method test_tool_with_union_type_return (line 646) | def test_tool_with_union_type_return(self): class TestToolDecorator (line 661) | class TestToolDecorator: method test_tool_decorator_source_extraction_with_multiple_decorators (line 662) | def test_tool_decorator_source_extraction_with_multiple_decorators(self): method test_tool_decorator_source_extraction_with_multiline_signature (line 695) | def test_tool_decorator_source_extraction_with_multiline_signature(self): method test_tool_decorator_source_extraction_with_multiple_decorators_and_multiline (line 742) | def test_tool_decorator_source_extraction_with_multiple_decorators_and... function mock_server_parameters (line 800) | def mock_server_parameters(): function mock_mcp_adapt (line 805) | def mock_mcp_adapt(): function mock_smolagents_adapter (line 813) | def mock_smolagents_adapter(): class TestToolCollection (line 820) | class TestToolCollection: method test_from_mcp (line 821) | def test_from_mcp(self, mock_server_parameters, mock_mcp_adapt, mock_s... method test_integration_from_mcp (line 829) | def test_integration_from_mcp(self): method test_integration_from_mcp_with_streamable_http (line 853) | def test_integration_from_mcp_with_streamable_http(self): method test_integration_from_mcp_with_sse (line 890) | def test_integration_from_mcp_with_sse(self): function test_launch_gradio_demo_does_not_raise (line 929) | def test_launch_gradio_demo_does_not_raise(tool_fixture_name, request): function test_validate_tool_arguments (line 954) | def test_validate_tool_arguments(tool_input_type, expected_input, expect... function test_validate_tool_arguments_nullable (line 1035) | def test_validate_tool_arguments_nullable(scenario, type_hint, default, ... FILE: tests/test_types.py function get_new_path (line 27) | def get_new_path(suffix="") -> str: class AgentAudioTests (line 34) | class AgentAudioTests(unittest.TestCase): method test_from_tensor (line 35) | def test_from_tensor(self): method test_from_string (line 55) | def test_from_string(self): class TestAgentImage (line 70) | class TestAgentImage: method test_from_tensor (line 71) | def test_from_tensor(self): method test_from_string (line 87) | def test_from_string(self, shared_datadir): method test_from_image (line 99) | def test_from_image(self, shared_datadir): class AgentTextTests (line 112) | class AgentTextTests(unittest.TestCase): method test_from_string (line 113) | def test_from_string(self): FILE: tests/test_utils.py class ValidTool (line 35) | class ValidTool(Tool): method __init__ (line 43) | def __init__(self, optional_param="default"): method forward (line 47) | def forward(self, input: str) -> str: function valid_tool_function (line 52) | def valid_tool_function(input: str) -> str: class AgentTextTests (line 102) | class AgentTextTests(unittest.TestCase): method test_parse_code_blobs (line 103) | def test_parse_code_blobs(self): method test_multiple_code_blobs (line 140) | def test_multiple_code_blobs(self): function ipython_shell (line 147) | def ipython_shell(): function test_get_source_ipython (line 162) | def test_get_source_ipython(ipython_shell, obj_name, code_blob): function test_get_source_standard_class (line 168) | def test_get_source_standard_class(): function test_get_source_standard_function (line 176) | def test_get_source_standard_function(): function test_get_source_ipython_errors_empty_cells (line 184) | def test_get_source_ipython_errors_empty_cells(ipython_shell): function test_get_source_ipython_errors_definition_not_found (line 192) | def test_get_source_ipython_errors_definition_not_found(ipython_shell): function test_get_source_ipython_errors_type_error (line 200) | def test_get_source_ipython_errors_type_error(): function test_instance_to_source (line 208) | def test_instance_to_source(tool, expected_tool_source): function test_e2e_class_tool_save (line 213) | def test_e2e_class_tool_save(tmp_path): function test_e2e_ipython_class_tool_save (line 267) | def test_e2e_ipython_class_tool_save(tmp_path): function test_e2e_function_tool_save (line 324) | def test_e2e_function_tool_save(tmp_path): function test_e2e_ipython_function_tool_save (line 374) | def test_e2e_ipython_function_tool_save(tmp_path): function test_parse_json_blob_with_valid_json (line 467) | def test_parse_json_blob_with_valid_json(raw_json, expected_data, expect... function test_parse_json_blob_with_invalid_json (line 484) | def test_parse_json_blob_with_invalid_json(raw_json): function test_is_valid_name (line 515) | def test_is_valid_name(name, expected): function test_agent_gradio_app_template_excludes_class_keyword (line 520) | def test_agent_gradio_app_template_excludes_class_keyword(): FILE: tests/test_vision_web_browser.py function mock_driver (line 11) | def mock_driver(): class TestXPathEscaping (line 19) | class TestXPathEscaping: method test_escape_xpath_string_basic (line 39) | def test_escape_xpath_string_basic(self, input_text, expected_pattern): method test_escape_xpath_string_mixed_quotes (line 52) | def test_escape_xpath_string_mixed_quotes(self, input_text): method test_escape_prevents_injection (line 67) | def test_escape_prevents_injection(self, malicious_input): class TestSearchItemCtrlF (line 78) | class TestSearchItemCtrlF: method test_search_item_prevents_injection (line 91) | def test_search_item_prevents_injection(self, search_text, mock_driver): method test_search_item_nth_result (line 115) | def test_search_item_nth_result(self, mock_driver): method test_search_item_not_found (line 126) | def test_search_item_not_found(self, mock_driver):