Skip to content

Instantly share code, notes, and snippets.

View bemijonathan's full-sized avatar
🎓
Learning

Jonathan Atiene bemijonathan

🎓
Learning
View GitHub Profile
@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?"
]
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
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)
class BaseAgent():
def __init__(self, name, role, provider_config, tools):
self.name = name
self.role = role
self.memory = []
self.provider = provider_config
self.tools = tools
async def use_tool(self, tool_name, params: Dict[str, Any])
"""Execute a tool with given parameters"""
# Crazyflie autonomous control, [email protected]
from controller import Receiver, Emitter
from controller import Robot
from crazyflie_flyingcontroller import CrazyflieFlyingController
from controller import Keyboard
import math
import numpy as np
@bemijonathan
bemijonathan / gist:8bc892b1e12954e45a906e0704cff86d
Last active May 15, 2025 13:58
Customizing your code review experience with coderabbit.yml

Customizing CI Code Review with CodeRabbit

Overview

CodeRabbit allows developers to customize your ai review review process by defining the settings in a coderabbit.yml file. This document provides a brief overview of the keys used in the coderabbit.yml file and their functions. please note that the default parameters in the schema will be used if values are not provided.

Sample coderabbit.yml File

@bemijonathan
bemijonathan / doc.md
Last active September 19, 2023 11:18
Enhancing a coderabbit reviews with file path prompts

Introduction

This documentation describes how to add specific code review instructions to match specific glob files path in your project, This feature allows developers to set custom instructions for code review based on file paths, thus enhancing the effectiveness of the code reviews from coderabbit.

Overview

Adding file path prompts allows developers to specify custom instructions for different parts of the codebase. For example, you may want to enforce the use of standard JS format for reviewing TypeScript files in a specific directory: or the Google Style Guide for your tsx files in another directory, specifying these instructions ultimately increase the accuracy the reviews

"use strict"
const fs = require("fs");
const assert = require("assert");
const inputValues = []
//get all values from the file input;
fs.readFileSync("input.txt", "utf-8")
.split('\n\n')
@bemijonathan
bemijonathan / GitHub curl.sh
Created February 27, 2021 09:53 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"