This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import ollama | |
import asyncio | |
import sympy as sp | |
def evaluate_math_expression(expression: str) -> str: | |
try: | |
result = sp.sympify(expression).evalf() | |
return json.dumps({"result": str(result)}) | |
except Exception as e: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.