Skip to content

Instantly share code, notes, and snippets.

View lemassykoi's full-sized avatar

Clément PAPPALARDO lemassykoi

View GitHub Profile
@lemassykoi
lemassykoi / main.py
Last active April 21, 2025 01:37
This Python script is an asynchronous task management system that uses the Ollama LLM service to handle complex queries by breaking them into smaller tasks. It employs an event broker for communication and includes components like a client, server, supervisor, agent, and sub-agent to process and synthesize reports.
import asyncio
import logging
import json
from typing import Dict, Any
from ollama import AsyncClient
import aiohttp
#USER_QUERY = "Generate a report about the solar system"
#USER_QUERY = "Generate a report about large language models"
USER_QUERY = "Rédige un rapport complet sur les transformations à venir dans le monde du travail, causées par l'intelligence artificielle abordable et démocratisée."
@lemassykoi
lemassykoi / mcp_server_agents.py
Created March 27, 2025 14:41
Provide Agents as a tool, with MCP
import os
import json
import aiohttp
import datetime
from contextlib import asynccontextmanager
from typing import AsyncIterator
from mcp.server.fastmcp import FastMCP, Context
from mcp.server import Server
from swarm import Swarm, Agent
from duckduckgo_search import DDGS
@lemassykoi
lemassykoi / main.py
Last active March 27, 2025 01:45
Test Ollama with 2 shots in a row to check for reproducible output (Chat, Generate, Embed)
import ollama
import os
import sys
import time
import requests
import uuid
import json
import colorama
from ollama import Client
@lemassykoi
lemassykoi / main.py
Last active March 16, 2025 16:49
Test Ollama with 2 shots in a row to check for reproducible output
import ollama
import colorama
import os
import time
import requests
import json
B_RED = colorama.Back.RED
RED = colorama.Fore.RED
BLUE = colorama.Fore.BLUE
@lemassykoi
lemassykoi / main.py
Created November 7, 2024 05:25
Ollama Langchain Structured Chat Agent en Français
"""
Script de gestion d'interaction avec un modèle linguistique d'intelligence artificielle (LLM).
Ce script permet l'échange bidirectionnel de messages entre un utilisateur humain et une intelligence artificielle,
en utilisant le modèle linguistique de son choix, avec Ollama.
Il incorpore des fonctionnalités telles que la recherche web, la résolution d'informations en temps réel,
et l'intégration de mémoires internes pour améliorer les capacités de réponse et d'apprentissage continu du système.
Auteurs:
@lemassykoi
lemassykoi / XTB_FOREX_trader.py
Created August 26, 2024 13:28
XTB FOREX Scalp Trading
print('\nStart\n')
import time # noqa: E402
start_time = time.perf_counter()
import os # noqa: E402
import html # noqa: E402
import datetime # noqa: E402
import asyncio # noqa: E402
import websockets # noqa: E402
import json # noqa: E402
import logging # noqa: E402
@lemassykoi
lemassykoi / run.py
Last active July 13, 2024 19:49
Ollama with custom Tools and Domoticz Interaction, on Telegram
import logging
import time
import asyncio
import aiohttp
import requests
import json
from langchain_experimental.llms.ollama_functions import OllamaFunctions
from langchain_core.messages import AIMessage, HumanMessage
from aiogram import Bot, Dispatcher, F
from aiogram.enums import ParseMode
@lemassykoi
lemassykoi / how_to_squid_krb_AD.sh
Last active January 11, 2024 10:55
Squid with Kerberos Active Directory and SquidGuard (with Active Directory too, and Groups)
## Debian 12 US - 01/01/2024
##
## assuming your default user is "debian"
## assuming your Windows Server 2016 minimum is the CA for the domain
## you have to issue a certificate from your CA to proxy.yourdomain.local (for CN and DNS alt name. You can add IP alt name)
## (build a CSR with an online tool and KEEP the private key
## !! you also need to enable the option which says this certificate will be used to issue other certificate) !!
##
## COMPUTER NAME of the proxy is different of the value used for proxy settings :
## computer name : LINUX01(.yourdomain.local)
@lemassykoi
lemassykoi / update_ubuntu_netboot.sh
Created January 20, 2023 23:03
Script made to update Ubuntu Netboot for PXE Server
#!/usr/bin/env bash
# crontab -e
# 0 3 * * * /bin/bash /root/update_ubuntu_netboot.sh
# apt install syslinux-common
#=============================================
ubuntu_files='/srv/tftp/images/ubuntu'
iso_location='/srv/tftp/images/ISO'
dist=("focal" "jammy")
# focal 20.04
# jammy 22.04