Skip to content

Instantly share code, notes, and snippets.

View lorenzejay's full-sized avatar

Lorenze Jay lorenzejay

View GitHub Profile
@lorenzejay
lorenzejay / interoperable_crew.py
Last active May 29, 2025 21:31
Interoperable Crew
# uv pip install crewai crewai-tools pydantic==2.9.2 langchain-core langgraph openai-agents
import json
from typing import List
from crewai_tools import SerperDevTool
from langchain_openai import ChatOpenAI
from pydantic import BaseModel
from crewai.agents.agent_adapters.langgraph.langgraph_adapter import (
@lorenzejay
lorenzejay / flow_eval_example.py
Last active May 5, 2025 04:41
Custom Event Listener Example
from crewai.utilities.events import (
TaskCompletedEvent,
)
from crewai.utilities.events.base_event_listener import BaseEventListener
from crewai.task import Task
from crewai.utilities.evaluators.task_evaluator import TaskEvaluator
from crewai.utilities.events.crewai_event_bus import CrewAIEventsBus
from opik.evaluation.metrics import Hallucination
@lorenzejay
lorenzejay / custom_knowledge_storage.py
Last active February 19, 2025 19:52
Extending KnowledgeStorage from Chroma-> Qdrant example
from typing import Any, Dict, List, Optional, Union
from qdrant_client import QdrantClient
from crewai.knowledge.storage.knowledge_storage import KnowledgeStorage
class QdrantStorage(KnowledgeStorage):
"""
Extends Storage to handle embeddings for memory entries using Qdrant.
@lorenzejay
lorenzejay / rag_tool_with_custom_vector_db.py
Last active February 19, 2025 19:39
CrewAI Rag tool set a custom vectordb
from crewai_tools import RagTool
from dotenv import load_dotenv
from crewai import Agent, Crew, Process, Task
load_dotenv()
rag_tool = RagTool(
config={
@lorenzejay
lorenzejay / openUrlWithChrome.applescript
Created September 19, 2022 15:30
opening calendar url from input to google chrome
#!/usr/bin/env osascript -l JavaScript
const chrome = Application("Google Chrome");
const window = chrome.Window().make();
function run(input) {
const url = input[0][0];
let tab = chrome.Tab({url});
if(url.startsWith("https")){
return chrome.windows[0].tabs[0].url = url;
}{
@lorenzejay
lorenzejay / setup-morning.automation.applescript
Last active September 22, 2022 17:08
My script that is triggered with launchd every working morning
tell application "Shortcuts" to run shortcut "MorningAutomationDNDToggler"
tell application "Calendar" to activate
tell application "zoom.us" to launch
tell application "Spotify" to launch
if application "Spotify" is running then
tell application "Spotify"
play track "spotify:track:7eTxWRSvauWm5L3FblGk2h"
end tell
end if
tell application "Google Chrome" to activate (open location "https://hashnode.com/")
const Build = () => {
const router = useRouter();
const { session } = useContext(UserContext);
useEffect(() => {
if (!session) {
router.push("/signin");
}
}, [session]);
return (