SymPyToolkit
init
- default_variable (str): The default variable for operations (default: :obj:
x
)
simplify_expression
- expression (str): The mathematical expression to simplify, provided as a string.
"result"
field. If an error occurs,
the "status"
field will be set to "error"
with a
corresponding "message"
.
expand_expression
- expression (str): The algebraic expression to expand, provided as a string.
"result"
field. If an error occurs, the JSON
string will include an "error"
field with the corresponding
error message.
factor_expression
- expression (str): The algebraic expression to factor, provided as a string.
"result"
field. If an error occurs, the JSON string
will include an "error"
field with the corresponding error
message.
solve_linear_system
- equations (List[str]): A list of strings representing the linear equations to be solved.
- variables (List[str]): A list of strings representing the variables involved in the equations.
"result"
field. Each solution is represented as
a tuple of values corresponding to the variables. If an
error occurs, the JSON string will include an "error"
field with the corresponding error message.
solve_nonlinear_system
- sympy_equations (List[str]): A list of strings representing the nonlinear equations to be solved. The equation to solve, must be compatible with SymPy, provided as a string.
- variables (List[str]): A list of strings representing the variables involved in the equations.
"result"
field. Each solution is
represented as a tuple of values corresponding to the
variables. If an error occurs, the JSON string will
include an "error"
field with the corresponding
error message.
solve_univariate_inequality
- inequality (str): A string representing the inequality to be solved.
- variable (str): The variable in the inequality.
"result"
field. The solution is represented in a symbolic
format (e.g., intervals or expressions). If an error occurs,
the JSON string will include an "error"
field with the
corresponding error message.
reduce_inequalities
- inequalities (List[str]): A list of strings representing the inequalities to be reduced.
"result"
field. The solution is represented in
a symbolic format (e.g., combined intervals or expressions).
If an error occurs, the JSON string will include an "error"
field with the corresponding error message.
polynomial_representation
- expression (str): The mathematical expression to represent as a polynomial, provided as a string.
- variable (str): The variable with respect to which the polynomial representation will be created.
"result"
field. The polynomial is returned
in a symbolic format. If an error occurs, the JSON string will
include an "error"
field with the corresponding error
message.
polynomial_degree
- expression (str): The polynomial expression for which the degree is to be determined, provided as a string.
- variable (str): The variable with respect to which the degree of the polynomial is calculated.
"result"
field. If an error occurs, the JSON string will
include an "error"
field with the corresponding error
message.
polynomial_coefficients
- expression (str): The polynomial expression from which the coefficients are to be extracted, provided as a string.
- variable (str): The variable with respect to which the polynomial coefficients are determined.
"result"
field. The coefficients are
ordered from the highest degree term to the constant term.
If an error occurs, the JSON string will include an `“error”
field with the corresponding error message.
solve_equation
- sympy_equation (str): The equation to solve, must be compatible with SymPy, provided as a string.
- variable (str, optional): The variable to solve for. If not specified, the function will use the default variable.
"result"
field. Each solution is represented as a string.
If an error occurs, the JSON string will include an "error"
field with the corresponding error message.
find_roots
- expression (str): The polynomial or algebraic equation for which the roots are to be found, provided as a string.
"result"
field. The roots are represented as a list of
solutions. If an error occurs, the JSON string will include
a "status"
field set to "error"
and a "message"
field
with the corresponding error description.
differentiate
- expression (str): The mathematical expression to differentiate, provided as a string.
- variable (str, optional): The variable with respect to which the differentiation is performed. If not specified, the default variable is used.
"result"
field. If an error occurs, the JSON string will
include an "error"
field with the corresponding error
message.
integrate
- expression (str): The mathematical expression to integrate, provided as a string.
- variable (str, optional): The variable with respect to which the integration is performed. If not specified, the default variable is used.
"result"
field. If an error occurs, the JSON string will
include an "error"
field with the corresponding error
message.
definite_integral
- expression (str): The mathematical expression to integrate, provided as a string.
- variable (str): The variable with respect to which the definite integration is performed.
- lower (float): The lower limit of the integration.
- upper (float): The upper limit of the integration.
"result"
field. If an error occurs, the JSON string
will include an "error"
field with the corresponding error
message.
series_expansion
- expression (str): The mathematical expression to expand, provided as a string.
- variable (str): The variable with respect to which the series expansion is performed.
- point (float): The point around which the Taylor series is expanded.
- order (int): The order up to which the series expansion is computed.
"result"
field. If an error occurs,
the JSON string will include an "error"
field with the
corresponding error message.
compute_limit
- expression (str): The mathematical expression for which the limit is to be computed, provided as a string.
- variable (str): The variable with respect to which the limit is computed.
- point (float): The point that the variable approaches.
"result"
field. If an error occurs, the JSON string
will include an "error"
field with the corresponding error
message.
find_critical_points
- expression (str): The mathematical expression for which critical points are to be found, provided as a string.
- variable (str): The variable with respect to which the critical points are determined.
"result"
field. The critical points are returned as a
list of values corresponding to the variable. If an error
occurs, the JSON string will include an "error"
field with
the corresponding error message.
check_continuity
- expression (str): The mathematical expression to check for continuity, provided as a string.
- variable (str): The variable with respect to which continuity is checked.
- point (float): The point at which the continuity of the expression is checked.
"result"
field. The result will be "True"
if the
expression is continuous at the given point, otherwise
"False"
. If an error occurs, the JSON string will include
an "error"
field with the corresponding error message.
compute_determinant
- matrix (List[List[float]]): A two-dimensional list representing the matrix for which the determinant is to be computed.
"result"
field. If an error occurs, the JSON string will
include an "error"
field with the corresponding error
message.
compute_inverse
- matrix (List[List[float]]): A two-dimensional list representing the matrix for which the inverse is to be computed.
"result"
field. The inverse is represented in a symbolic
matrix format. If an error occurs, the JSON string will
include an "error"
field with the corresponding error
message.
compute_eigenvalues
- matrix (List[List[float]]): A two-dimensional list representing the matrix for which the eigenvalues are to be computed.
"result"
field. The eigenvalues are represented as a
dictionary where keys are the eigenvalues (as strings) and
values are their multiplicities (as strings). If an error
occurs, the JSON string will include an "error"
field
with the corresponding error message.
compute_eigenvectors
- matrix (List[List[float]]): A two-dimensional list representing the matrix for which the eigenvectors are to be computed.
"result"
field. Each eigenvalue is represented as a
dictionary with the following keys:
"eigenvalue"
: The eigenvalue (as a string)."multiplicity"
: The multiplicity of the eigenvalue (as an integer)."eigenvectors"
: A list of eigenvectors (each represented as a string).
"error"
field with the corresponding error message.
compute_nullspace
- matrix (List[List[float]]): A two-dimensional list representing the matrix for which the null space is to be computed.
"result"
field. The null space is represented as a list of
basis vectors, where each vector is given as a string in
symbolic format. If an error occurs, the JSON string will
include an "error"
field with the corresponding error
message.
compute_rank
- matrix (List[List[float]]): A two-dimensional list representing the matrix for which the rank is to be computed.
"result"
field. The rank is represented as an integer.
If an error occurs,the JSON string will include an
"error"
field with the corresponding error message.
compute_inner_product
- vector1 (List[float]): The first vector as a list of floats.
- vector2 (List[float]): The second vector as a list of floats.
"result"
field. If an error occurs, the JSON string will include an
"error"
field with the corresponding error message.
handle_exception
- func_name (str): The name of the function where the exception occurred.
- error (Exception): The exception object containing details about the error.
"status"
: Always set to"error"
."message"
: A string representation of the exception message.
get_tools
FunctionTool
objects representing
the toolkit’s methods, making them accessible to the agent.