repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/adapters.py
src/requests/adapters.py
""" requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket # noqa: F401 import typing import warnings from urllib3.exceptions import ClosedPoolError, ConnectTimeoutError from urllib3.exceptions import HT...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/_internal_utils.py
src/requests/_internal_utils.py
""" requests._internal_utils ~~~~~~~~~~~~~~ Provides utility functions that are consumed internally by Requests which depend on extremely few external helpers (such as compat) """ import re from .compat import builtin_str _VALID_HEADER_NAME_RE_BYTE = re.compile(rb"^[^:\s][^:\r\n]*$") _VALID_HEADER_NAME_RE_STR = re.c...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/__init__.py
src/requests/__init__.py
# __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP Library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> r.status_code 200 >...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/structures.py
src/requests/structures.py
""" requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ from collections import OrderedDict from .compat import Mapping, MutableMapping class CaseInsensitiveDict(MutableMapping): """A case-insensitive ``dict``-like object. Implements all methods and operations of ``Mutable...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/sessions.py
src/requests/sessions.py
""" requests.sessions ~~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os import sys import time from collections import OrderedDict from datetime import timedelta from ._internal_utils import to_native_string from .adapters im...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/certs.py
src/requests/certs.py
#!/usr/bin/env python """ requests.certs ~~~~~~~~~~~~~~ This module returns the preferred default CA certificate bundle. There is only one — the one from the certifi package. If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a s...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/hooks.py
src/requests/hooks.py
""" requests.hooks ~~~~~~~~~~~~~~ This module provides the capabilities for the Requests hooks system. Available hooks: ``response``: The response generated from a Request. """ HOOKS = ["response"] def default_hooks(): return {event: [] for event in HOOKS} # TODO: response is the only one def dispatch_...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/auth.py
src/requests/auth.py
""" requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import hashlib import os import re import threading import time import warnings from base64 import b64encode from ._internal_utils import to_native_string from .compat import basestring, str, urlparse from .cookies imp...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/__version__.py
src/requests/__version__.py
# .-. .-. .-. . . .-. .-. .-. .-. # |( |- |.| | | |- `-. | `-. # ' ' `-' `-`.`-' `-' `-' ' `-' __title__ = "requests" __description__ = "Python HTTP for Humans." __url__ = "https://requests.readthedocs.io" __version__ = "2.32.5" __build__ = 0x023205 __author__ = "Kenneth Reitz" __author_email__ = "me@kennethrei...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/help.py
src/requests/help.py
"""Module containing bug report helper(s).""" import json import platform import ssl import sys import idna import urllib3 from . import __version__ as requests_version try: import charset_normalizer except ImportError: charset_normalizer = None try: import chardet except ImportError: chardet = Non...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/status_codes.py
src/requests/status_codes.py
r""" The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. Example:: >>> import requests >>> requests.codes['temporary_redirect'] 307 >>> requests.codes.teapot 418 >>> requests.codes['\o/'] ...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/packages.py
src/requests/packages.py
import sys from .compat import chardet # This code exists for backwards compatibility reasons. # I don't like it either. Just look the other way. :) for package in ("urllib3", "idna"): locals()[package] = __import__(package) # This traversal is apparently necessary such that the identities are # preserve...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/test_testserver.py
tests/test_testserver.py
import socket import threading import time import pytest from tests.testserver.server import Server import requests class TestTestServer: def test_basic(self): """messages are sent and received properly""" question = b"success?" answer = b"yeah, success" def handler(sock): ...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/test_adapters.py
tests/test_adapters.py
import requests.adapters def test_request_url_trims_leading_path_separators(): """See also https://github.com/psf/requests/issues/6643.""" a = requests.adapters.HTTPAdapter() p = requests.Request(method="GET", url="http://127.0.0.1:10000//v:h").prepare() assert "/v:h" == a.request_url(p, {})
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/test_hooks.py
tests/test_hooks.py
import pytest from requests import hooks def hook(value): return value[1:] @pytest.mark.parametrize( "hooks_list, result", ( (hook, "ata"), ([hook, lambda x: None, hook], "ta"), ), ) def test_hooks(hooks_list, result): assert hooks.dispatch_hook("response", {"response": hooks_li...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/test_utils.py
tests/test_utils.py
import copy import filecmp import os import tarfile import zipfile from collections import deque from io import BytesIO from unittest import mock import pytest from requests import compat from requests._internal_utils import unicode_is_ascii from requests.cookies import RequestsCookieJar from requests.structures impo...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/compat.py
tests/compat.py
import warnings try: import StringIO except ImportError: import io as StringIO try: from cStringIO import StringIO as cStringIO except ImportError: cStringIO = None def u(s): warnings.warn( ( "This helper function is no longer relevant in Python 3. " "Usage of thi...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/conftest.py
tests/conftest.py
try: from http.server import HTTPServer, SimpleHTTPRequestHandler except ImportError: from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler import ssl import threading import pytest from requests.compat import urljoin def prepare_url(value): # Issue #1483: Make...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/utils.py
tests/utils.py
import contextlib import os @contextlib.contextmanager def override_environ(**kwargs): save_env = dict(os.environ) for key, value in kwargs.items(): if value is None: del os.environ[key] else: os.environ[key] = value try: yield finally: os.enviro...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/test_lowlevel.py
tests/test_lowlevel.py
import threading import pytest from tests.testserver.server import Server, consume_socket_content import requests from requests.compat import JSONDecodeError from .utils import override_environ def echo_response_handler(sock): """Simple handler that will take request and echo it back to requester.""" reque...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/__init__.py
tests/__init__.py
"""Requests test package initialisation.""" import warnings try: from urllib3.exceptions import SNIMissingWarning # urllib3 1.x sets SNIMissingWarning to only go off once, # while this test suite requires it to always fire # so that it occurs during test_requests.test_https_warnings warnings.simp...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/test_packages.py
tests/test_packages.py
import requests def test_can_access_urllib3_attribute(): requests.packages.urllib3 def test_can_access_idna_attribute(): requests.packages.idna def test_can_access_chardet_attribute(): requests.packages.chardet
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/test_help.py
tests/test_help.py
from unittest import mock from requests.help import info def test_system_ssl(): """Verify we're actually setting system_ssl when it should be available.""" assert info()["system_ssl"]["version"] != "" class VersionedPackage: def __init__(self, version): self.__version__ = version def test_idn...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/test_structures.py
tests/test_structures.py
import pytest from requests.structures import CaseInsensitiveDict, LookupDict class TestCaseInsensitiveDict: @pytest.fixture(autouse=True) def setup(self): """CaseInsensitiveDict instance with "Accept" header.""" self.case_insensitive_dict = CaseInsensitiveDict() self.case_insensitive...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/test_requests.py
tests/test_requests.py
"""Tests for Requests.""" import collections import contextlib import io import json import os import pickle import re import tempfile import threading import warnings from unittest import mock import pytest import urllib3 from urllib3.util import Timeout as Urllib3Timeout import requests from requests.adapters impo...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
true
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/testserver/__init__.py
tests/testserver/__init__.py
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/tests/testserver/server.py
tests/testserver/server.py
import select import socket import ssl import threading def consume_socket_content(sock, timeout=0.5): chunks = 65536 content = b"" while True: more_to_read = select.select([sock], [], [], timeout)[0] if not more_to_read: break new_content = sock.recv(chunks) ...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # Requests documentation build configuration file, created by # sphinx-quickstart on Fri Feb 19 00:05:47 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
psf/requests
https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/docs/_themes/flask_theme_support.py
docs/_themes/flask_theme_support.py
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
python
Apache-2.0
70298332899f25826e35e42f8d83425124f755a5
2026-01-04T14:39:22.525405Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/setup.py
setup.py
from setuptools import find_packages, setup with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( name="openmanus", version="0.1.0", author="mannaandpoem and OpenManus Team", author_email="mannaandpoem@gmail.com", description="A versatile agent that can solv...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/sandbox_main.py
sandbox_main.py
import argparse import asyncio from app.agent.sandbox_agent import SandboxManus from app.logger import logger async def main(): # Parse command line arguments parser = argparse.ArgumentParser(description="Run Manus agent with a prompt") parser.add_argument( "--prompt", type=str, required=False, h...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/run_mcp.py
run_mcp.py
#!/usr/bin/env python import argparse import asyncio import sys from app.agent.mcp import MCPAgent from app.config import config from app.logger import logger class MCPRunner: """Runner class for MCP Agent with proper path handling and configuration.""" def __init__(self): self.root_path = config.ro...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/main.py
main.py
import argparse import asyncio from app.agent.manus import Manus from app.logger import logger async def main(): # Parse command line arguments parser = argparse.ArgumentParser(description="Run Manus agent with a prompt") parser.add_argument( "--prompt", type=str, required=False, help="Input prom...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/run_flow.py
run_flow.py
import asyncio import time from app.agent.data_analysis import DataAnalysis from app.agent.manus import Manus from app.config import config from app.flow.flow_factory import FlowFactory, FlowType from app.logger import logger async def run_flow(): agents = { "manus": Manus(), } if config.run_flow...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/run_mcp_server.py
run_mcp_server.py
# coding: utf-8 # A shortcut to launch OpenManus MCP server, where its introduction also solves other import issues. from app.mcp.server import MCPServer, parse_args if __name__ == "__main__": args = parse_args() # Create and run server (maintaining original flow) server = MCPServer() server.run(tran...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/llm.py
app/llm.py
import math from typing import Dict, List, Optional, Union import tiktoken from openai import ( APIError, AsyncAzureOpenAI, AsyncOpenAI, AuthenticationError, OpenAIError, RateLimitError, ) from openai.types.chat import ChatCompletion, ChatCompletionMessage from tenacity import ( retry, ...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/schema.py
app/schema.py
from enum import Enum from typing import Any, List, Literal, Optional, Union from pydantic import BaseModel, Field class Role(str, Enum): """Message role options""" SYSTEM = "system" USER = "user" ASSISTANT = "assistant" TOOL = "tool" ROLE_VALUES = tuple(role.value for role in Role) ROLE_TYPE ...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/exceptions.py
app/exceptions.py
class ToolError(Exception): """Raised when a tool encounters an error.""" def __init__(self, message): self.message = message class OpenManusError(Exception): """Base exception for all OpenManus errors""" class TokenLimitExceeded(OpenManusError): """Exception raised when the token limit is ...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/logger.py
app/logger.py
import sys from datetime import datetime from loguru import logger as _logger from app.config import PROJECT_ROOT _print_level = "INFO" def define_log_level(print_level="INFO", logfile_level="DEBUG", name: str = None): """Adjust the log level to above level""" global _print_level _print_level = print_...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/config.py
app/config.py
import json import threading import tomllib from pathlib import Path from typing import Dict, List, Optional from pydantic import BaseModel, Field def get_project_root() -> Path: """Get the project root directory""" return Path(__file__).resolve().parent.parent PROJECT_ROOT = get_project_root() WORKSPACE_R...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/__init__.py
app/__init__.py
# Python version check: 3.11-3.13 import sys if sys.version_info < (3, 11) or sys.version_info > (3, 13): print( "Warning: Unsupported Python version {ver}, please use 3.11-3.13".format( ver=".".join(map(str, sys.version_info)) ) )
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/bedrock.py
app/bedrock.py
import json import sys import time import uuid from datetime import datetime from typing import Dict, List, Literal, Optional import boto3 # Global variables to track the current tool use ID across function calls # Tmp solution CURRENT_TOOLUSE_ID = None # Class to handle OpenAI-style response formatting class Open...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/flow/flow_factory.py
app/flow/flow_factory.py
from enum import Enum from typing import Dict, List, Union from app.agent.base import BaseAgent from app.flow.base import BaseFlow from app.flow.planning import PlanningFlow class FlowType(str, Enum): PLANNING = "planning" class FlowFactory: """Factory for creating different types of flows with support for...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/flow/planning.py
app/flow/planning.py
import json import time from enum import Enum from typing import Dict, List, Optional, Union from pydantic import Field from app.agent.base import BaseAgent from app.flow.base import BaseFlow from app.llm import LLM from app.logger import logger from app.schema import AgentState, Message, ToolChoice from app.tool imp...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/flow/__init__.py
app/flow/__init__.py
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/flow/base.py
app/flow/base.py
from abc import ABC, abstractmethod from typing import Dict, List, Optional, Union from pydantic import BaseModel from app.agent.base import BaseAgent class BaseFlow(BaseModel, ABC): """Base class for execution flows supporting multiple agents""" agents: Dict[str, BaseAgent] tools: Optional[List] = Non...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/utils/files_utils.py
app/utils/files_utils.py
import os # Files to exclude from operations EXCLUDED_FILES = { ".DS_Store", ".gitignore", "package-lock.json", "postcss.config.js", "postcss.config.mjs", "jsconfig.json", "components.json", "tsconfig.tsbuildinfo", "tsconfig.json", } # Directories to exclude from operations EXCLUD...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/utils/logger.py
app/utils/logger.py
import logging import os import structlog ENV_MODE = os.getenv("ENV_MODE", "LOCAL") renderer = [structlog.processors.JSONRenderer()] if ENV_MODE.lower() == "local".lower(): renderer = [structlog.dev.ConsoleRenderer()] structlog.configure( processors=[ structlog.stdlib.add_log_level, structl...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/utils/__init__.py
app/utils/__init__.py
# Utility functions and constants for agent tools
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/prompt/toolcall.py
app/prompt/toolcall.py
SYSTEM_PROMPT = "You are an agent that can execute tool calls" NEXT_STEP_PROMPT = ( "If you want to stop interaction, use `terminate` tool/function call." )
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/prompt/swe.py
app/prompt/swe.py
SYSTEM_PROMPT = """SETTING: You are an autonomous programmer, and you're working directly in the command line with a special interface. The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time. In addition to typical bash commands, you can also use specific commands to help y...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/prompt/manus.py
app/prompt/manus.py
SYSTEM_PROMPT = ( "You are OpenManus, an all-capable AI assistant, aimed at solving any task presented by the user. You have various tools at your disposal that you can call upon to efficiently complete complex requests. Whether it's programming, information retrieval, file processing, web browsing, or human intera...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/prompt/planning.py
app/prompt/planning.py
PLANNING_SYSTEM_PROMPT = """ You are an expert Planning Agent tasked with solving problems efficiently through structured plans. Your job is: 1. Analyze requests to understand the task scope 2. Create a clear, actionable plan that makes meaningful progress with the `planning` tool 3. Execute steps using available tools...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/prompt/mcp.py
app/prompt/mcp.py
"""Prompts for the MCP Agent.""" SYSTEM_PROMPT = """You are an AI assistant with access to a Model Context Protocol (MCP) server. You can use the tools provided by the MCP server to complete tasks. The MCP server will dynamically expose tools that you can use - always check the available tools first. When using an MC...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/prompt/browser.py
app/prompt/browser.py
SYSTEM_PROMPT = """\ You are an AI agent designed to automate browser tasks. Your goal is to accomplish the ultimate task following the rules. # Input Format Task Previous steps Current URL Open Tabs Interactive Elements [index]<type>text</type> - index: Numeric identifier for interaction - type: HTML element type (bu...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/prompt/__init__.py
app/prompt/__init__.py
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/prompt/visualization.py
app/prompt/visualization.py
SYSTEM_PROMPT = """You are an AI agent designed to data analysis / visualization task. You have various tools at your disposal that you can call upon to efficiently complete complex requests. # Note: 1. The workspace directory is: {directory}; Read / write file in workspace 2. Generate analysis conclusion report in the...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/daytona/sandbox.py
app/daytona/sandbox.py
import time from daytona import ( CreateSandboxFromImageParams, Daytona, DaytonaConfig, Resources, Sandbox, SandboxState, SessionExecuteRequest, ) from app.config import config from app.utils.logger import logger # load_dotenv() daytona_settings = config.daytona logger.info("Initializing...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/daytona/tool_base.py
app/daytona/tool_base.py
from dataclasses import dataclass, field from datetime import datetime from typing import Any, ClassVar, Dict, Optional from daytona import Daytona, DaytonaConfig, Sandbox, SandboxState from pydantic import Field from app.config import config from app.daytona.sandbox import create_sandbox, start_supervisord_session f...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/sandbox/client.py
app/sandbox/client.py
from abc import ABC, abstractmethod from typing import Dict, Optional, Protocol from app.config import SandboxSettings from app.sandbox.core.sandbox import DockerSandbox class SandboxFileOperations(Protocol): """Protocol for sandbox file operations.""" async def copy_from(self, container_path: str, local_pa...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/sandbox/__init__.py
app/sandbox/__init__.py
""" Docker Sandbox Module Provides secure containerized execution environment with resource limits and isolation for running untrusted code. """ from app.sandbox.client import ( BaseSandboxClient, LocalSandboxClient, create_sandbox_client, ) from app.sandbox.core.exceptions import ( SandboxError, S...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/sandbox/core/terminal.py
app/sandbox/core/terminal.py
""" Asynchronous Docker Terminal This module provides asynchronous terminal functionality for Docker containers, allowing interactive command execution with timeout control. """ import asyncio import re import socket from typing import Dict, Optional, Tuple, Union import docker from docker import APIClient from dock...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/sandbox/core/exceptions.py
app/sandbox/core/exceptions.py
"""Exception classes for the sandbox system. This module defines custom exceptions used throughout the sandbox system to handle various error conditions in a structured way. """ class SandboxError(Exception): """Base exception for sandbox-related errors.""" class SandboxTimeoutError(SandboxError): """Excep...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/sandbox/core/sandbox.py
app/sandbox/core/sandbox.py
import asyncio import io import os import tarfile import tempfile import uuid from typing import Dict, Optional import docker from docker.errors import NotFound from docker.models.containers import Container from app.config import SandboxSettings from app.sandbox.core.exceptions import SandboxTimeoutError from app.sa...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/sandbox/core/manager.py
app/sandbox/core/manager.py
import asyncio import uuid from contextlib import asynccontextmanager from typing import Dict, Optional, Set import docker from docker.errors import APIError, ImageNotFound from app.config import SandboxSettings from app.logger import logger from app.sandbox.core.sandbox import DockerSandbox class SandboxManager: ...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/toolcall.py
app/agent/toolcall.py
import asyncio import json from typing import Any, List, Optional, Union from pydantic import Field from app.agent.react import ReActAgent from app.exceptions import TokenLimitExceeded from app.logger import logger from app.prompt.toolcall import NEXT_STEP_PROMPT, SYSTEM_PROMPT from app.schema import TOOL_CHOICE_TYPE...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/swe.py
app/agent/swe.py
from typing import List from pydantic import Field from app.agent.toolcall import ToolCallAgent from app.prompt.swe import SYSTEM_PROMPT from app.tool import Bash, StrReplaceEditor, Terminate, ToolCollection class SWEAgent(ToolCallAgent): """An agent that implements the SWEAgent paradigm for executing code and ...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/data_analysis.py
app/agent/data_analysis.py
from pydantic import Field from app.agent.toolcall import ToolCallAgent from app.config import config from app.prompt.visualization import NEXT_STEP_PROMPT, SYSTEM_PROMPT from app.tool import Terminate, ToolCollection from app.tool.chart_visualization.chart_prepare import VisualizationPrepare from app.tool.chart_visua...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/manus.py
app/agent/manus.py
from typing import Dict, List, Optional from pydantic import Field, model_validator from app.agent.browser import BrowserContextHelper from app.agent.toolcall import ToolCallAgent from app.config import config from app.logger import logger from app.prompt.manus import NEXT_STEP_PROMPT, SYSTEM_PROMPT from app.tool imp...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/react.py
app/agent/react.py
from abc import ABC, abstractmethod from typing import Optional from pydantic import Field from app.agent.base import BaseAgent from app.llm import LLM from app.schema import AgentState, Memory class ReActAgent(BaseAgent, ABC): name: str description: Optional[str] = None system_prompt: Optional[str] = ...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/mcp.py
app/agent/mcp.py
from typing import Any, Dict, List, Optional, Tuple from pydantic import Field from app.agent.toolcall import ToolCallAgent from app.logger import logger from app.prompt.mcp import MULTIMEDIA_RESPONSE_PROMPT, NEXT_STEP_PROMPT, SYSTEM_PROMPT from app.schema import AgentState, Message from app.tool.base import ToolResu...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/browser.py
app/agent/browser.py
import json from typing import TYPE_CHECKING, Optional from pydantic import Field, model_validator from app.agent.toolcall import ToolCallAgent from app.logger import logger from app.prompt.browser import NEXT_STEP_PROMPT, SYSTEM_PROMPT from app.schema import Message, ToolChoice from app.tool import BrowserUseTool, T...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/sandbox_agent.py
app/agent/sandbox_agent.py
from typing import Dict, List, Optional from pydantic import Field, model_validator from app.agent.browser import BrowserContextHelper from app.agent.toolcall import ToolCallAgent from app.config import config from app.daytona.sandbox import create_sandbox, delete_sandbox from app.daytona.tool_base import SandboxTool...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/__init__.py
app/agent/__init__.py
from app.agent.base import BaseAgent from app.agent.browser import BrowserAgent from app.agent.mcp import MCPAgent from app.agent.react import ReActAgent from app.agent.swe import SWEAgent from app.agent.toolcall import ToolCallAgent __all__ = [ "BaseAgent", "BrowserAgent", "ReActAgent", "SWEAgent", ...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/base.py
app/agent/base.py
from abc import ABC, abstractmethod from contextlib import asynccontextmanager from typing import List, Optional from pydantic import BaseModel, Field, model_validator from app.llm import LLM from app.logger import logger from app.sandbox.client import SANDBOX_CLIENT from app.schema import ROLE_TYPE, AgentState, Memo...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/mcp/__init__.py
app/mcp/__init__.py
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/mcp/server.py
app/mcp/server.py
import logging import sys logging.basicConfig(level=logging.INFO, handlers=[logging.StreamHandler(sys.stderr)]) import argparse import asyncio import atexit import json from inspect import Parameter, Signature from typing import Any, Dict, Optional from mcp.server.fastmcp import FastMCP from app.logger import logg...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/crawl4ai.py
app/tool/crawl4ai.py
""" Crawl4AI Web Crawler Tool for OpenManus This tool integrates Crawl4AI, a high-performance web crawler designed for LLMs and AI agents, providing fast, precise, and AI-ready data extraction with clean Markdown generation. """ import asyncio from typing import List, Union from urllib.parse import urlparse from app...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/web_search.py
app/tool/web_search.py
import asyncio from typing import Any, Dict, List, Optional import requests from bs4 import BeautifulSoup from pydantic import BaseModel, ConfigDict, Field, model_validator from tenacity import retry, stop_after_attempt, wait_exponential from app.config import config from app.logger import logger from app.tool.base i...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/browser_use_tool.py
app/tool/browser_use_tool.py
import asyncio import base64 import json from typing import Generic, Optional, TypeVar from browser_use import Browser as BrowserUseBrowser from browser_use import BrowserConfig from browser_use.browser.context import BrowserContext, BrowserContextConfig from browser_use.dom.service import DomService from pydantic imp...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/planning.py
app/tool/planning.py
# tool/planning.py from typing import Dict, List, Literal, Optional from app.exceptions import ToolError from app.tool.base import BaseTool, ToolResult _PLANNING_TOOL_DESCRIPTION = """ A planning tool that allows the agent to create and manage plans for solving complex tasks. The tool provides functionality for crea...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/mcp.py
app/tool/mcp.py
from contextlib import AsyncExitStack from typing import Dict, List, Optional from mcp import ClientSession, StdioServerParameters from mcp.client.sse import sse_client from mcp.client.stdio import stdio_client from mcp.types import ListToolsResult, TextContent from app.logger import logger from app.tool.base import ...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/terminate.py
app/tool/terminate.py
from app.tool.base import BaseTool _TERMINATE_DESCRIPTION = """Terminate the interaction when the request is met OR if the assistant cannot proceed further with the task. When you have finished all the tasks, call this tool to end the work.""" class Terminate(BaseTool): name: str = "terminate" description: ...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/computer_use_tool.py
app/tool/computer_use_tool.py
import asyncio import base64 import logging import os import time from typing import Dict, Literal, Optional import aiohttp from pydantic import Field from app.daytona.tool_base import Sandbox, SandboxToolsBase from app.tool.base import ToolResult KEYBOARD_KEYS = [ "a", "b", "c", "d", "e", "...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/python_execute.py
app/tool/python_execute.py
import multiprocessing import sys from io import StringIO from typing import Dict from app.tool.base import BaseTool class PythonExecute(BaseTool): """A tool for executing Python code with timeout and safety restrictions.""" name: str = "python_execute" description: str = "Executes Python code string. N...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/file_operators.py
app/tool/file_operators.py
"""File operation interfaces and implementations for local and sandbox environments.""" import asyncio from pathlib import Path from typing import Optional, Protocol, Tuple, Union, runtime_checkable from app.config import SandboxSettings from app.exceptions import ToolError from app.sandbox.client import SANDBOX_CLIE...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/__init__.py
app/tool/__init__.py
from app.tool.base import BaseTool from app.tool.bash import Bash from app.tool.browser_use_tool import BrowserUseTool from app.tool.crawl4ai import Crawl4aiTool from app.tool.create_chat_completion import CreateChatCompletion from app.tool.planning import PlanningTool from app.tool.str_replace_editor import StrReplace...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/str_replace_editor.py
app/tool/str_replace_editor.py
"""File and directory manipulation tool with sandbox support.""" from collections import defaultdict from pathlib import Path from typing import Any, DefaultDict, List, Literal, Optional, get_args from app.config import config from app.exceptions import ToolError from app.tool import BaseTool from app.tool.base impor...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/base.py
app/tool/base.py
import json from abc import ABC, abstractmethod from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field from app.utils.logger import logger # class BaseTool(ABC, BaseModel): # name: str # description: str # parameters: Optional[dict] = None # class Config: # arbi...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/tool_collection.py
app/tool/tool_collection.py
"""Collection classes for managing multiple tools.""" from typing import Any, Dict, List from app.exceptions import ToolError from app.logger import logger from app.tool.base import BaseTool, ToolFailure, ToolResult class ToolCollection: """A collection of defined tools.""" class Config: arbitrary_t...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/ask_human.py
app/tool/ask_human.py
from app.tool import BaseTool class AskHuman(BaseTool): """Add a tool to ask human for help.""" name: str = "ask_human" description: str = "Use this tool to ask human for help." parameters: str = { "type": "object", "properties": { "inquire": { "type": "str...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/bash.py
app/tool/bash.py
import asyncio import os from typing import Optional from app.exceptions import ToolError from app.tool.base import BaseTool, CLIResult _BASH_DESCRIPTION = """Execute a bash command in the terminal. * Long running commands: For commands that may run indefinitely, it should be run in the background and the output sho...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/create_chat_completion.py
app/tool/create_chat_completion.py
from typing import Any, List, Optional, Type, Union, get_args, get_origin from pydantic import BaseModel, Field from app.tool import BaseTool class CreateChatCompletion(BaseTool): name: str = "create_chat_completion" description: str = ( "Creates a structured completion with specified output formatt...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/chart_visualization/data_visualization.py
app/tool/chart_visualization/data_visualization.py
import asyncio import json import os from typing import Any, Hashable import pandas as pd from pydantic import Field, model_validator from app.config import config from app.llm import LLM from app.logger import logger from app.tool.base import BaseTool class DataVisualization(BaseTool): name: str = "data_visual...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/chart_visualization/python_execute.py
app/tool/chart_visualization/python_execute.py
from app.config import config from app.tool.python_execute import PythonExecute class NormalPythonExecute(PythonExecute): """A tool for executing Python code with timeout and safety restrictions.""" name: str = "python_execute" description: str = """Execute Python code for in-depth data analysis / data r...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/chart_visualization/__init__.py
app/tool/chart_visualization/__init__.py
from app.tool.chart_visualization.chart_prepare import VisualizationPrepare from app.tool.chart_visualization.data_visualization import DataVisualization from app.tool.chart_visualization.python_execute import NormalPythonExecute __all__ = ["DataVisualization", "VisualizationPrepare", "NormalPythonExecute"]
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/chart_visualization/chart_prepare.py
app/tool/chart_visualization/chart_prepare.py
from app.tool.chart_visualization.python_execute import NormalPythonExecute class VisualizationPrepare(NormalPythonExecute): """A tool for Chart Generation Preparation""" name: str = "visualization_preparation" description: str = "Using Python code to generates metadata of data_visualization tool. Output...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/chart_visualization/test/report_demo.py
app/tool/chart_visualization/test/report_demo.py
import asyncio from app.agent.data_analysis import DataAnalysis # from app.agent.manus import Manus async def main(): agent = DataAnalysis() # agent = Manus() await agent.run( """Requirement: 1. Analyze the following data and generate a graphical data report in HTML format. The final product sh...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/chart_visualization/test/chart_demo.py
app/tool/chart_visualization/test/chart_demo.py
import asyncio from app.agent.data_analysis import DataAnalysis from app.logger import logger prefix = "Help me generate charts and save them locally, specifically:" tasks = [ { "prompt": "Help me show the sales of different products in different regions", "data": """Product Name,Region,Sales Cok...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false
FoundationAgents/OpenManus
https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/search/duckduckgo_search.py
app/tool/search/duckduckgo_search.py
from typing import List from duckduckgo_search import DDGS from app.tool.search.base import SearchItem, WebSearchEngine class DuckDuckGoSearchEngine(WebSearchEngine): def perform_search( self, query: str, num_results: int = 10, *args, **kwargs ) -> List[SearchItem]: """ DuckDuckGo se...
python
MIT
52a13f2a57d8c7f6737eefb02ccf569594d44273
2026-01-04T14:39:27.873507Z
false