Rename code_interpreter_toools.pt to code_interpreter_toools.py
Browse files
code_interpreter_toools.pt → code_interpreter_toools.py
RENAMED
|
@@ -1,9 +1,23 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# ========================== #
|
| 9 |
# 📋 Logging Setup
|
|
@@ -20,6 +34,10 @@ def setup_logger(log_file="execution.log"):
|
|
| 20 |
|
| 21 |
logger = setup_logger()
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
class Code_Interpreter:
|
| 24 |
|
| 25 |
def __init__ (
|
|
|
|
| 1 |
+
# ========================== #
|
| 2 |
+
# 📦 Imports and Setup
|
| 3 |
+
# ========================== #
|
| 4 |
+
import os
|
| 5 |
+
import io
|
| 6 |
+
import sys
|
| 7 |
+
import uuid
|
| 8 |
+
import base64
|
| 9 |
+
import traceback
|
| 10 |
+
import contextlib
|
| 11 |
+
import tempfile
|
| 12 |
+
import subprocess
|
| 13 |
+
import sqlite3
|
| 14 |
+
import logging
|
| 15 |
+
from typing import Dict, Any
|
| 16 |
+
import numpy as np
|
| 17 |
+
import pandas as pd
|
| 18 |
+
import matplotlib.pyplot as plt
|
| 19 |
+
from PIL import Image
|
| 20 |
+
from langchain_core.tools import tool
|
| 21 |
|
| 22 |
# ========================== #
|
| 23 |
# 📋 Logging Setup
|
|
|
|
| 34 |
|
| 35 |
logger = setup_logger()
|
| 36 |
|
| 37 |
+
# =================================================================== #
|
| 38 |
+
# Code interpreter tools for languages like Python, Java, C++, SQL and C
|
| 39 |
+
# =================================================================== #
|
| 40 |
+
|
| 41 |
class Code_Interpreter:
|
| 42 |
|
| 43 |
def __init__ (
|