Skip to content

Instantly share code, notes, and snippets.

View bemijonathan's full-sized avatar
🎓
Learning

Jonathan Atiene bemijonathan

🎓
Learning
View GitHub Profile
class BaseAgent():
"""Base class for all AI agents in the system."""
def __init__(self, name, role, provider_config, tools):
# initialize the agent
pass
def use_tool(self, tool_name, params):
"""Execute a tool with given parameters"""
tool = self.tools.get(tool_name)
from abc import ABC, abstractmethod
from typing import Any, Dict, Optional, List, Type, get_type_hints, Union
from dataclasses import dataclass
import inspect
import json
from functools import wraps
@dataclass
class ToolResult:
success: bool
@bemijonathan
bemijonathan / correction.py
Created January 20, 2025 14:18
JSON_agent_py
import json
import time
quesitons = [
"What is the area of a circle with radius of 1?",
# "What is the temperature in capital of United States of America?",
"I would like to learn more about Albert Einstein?",
"Does test-time chain-of-thought require special model training?"
]