Skip to content

Instantly share code, notes, and snippets.

View tareksanger's full-sized avatar
💡
Creating

Tarek tareksanger

💡
Creating
View GitHub Profile
from agents import Agent, Runner, function_tool # OpenAI Agents SDK components
from celery import Celery, chain
import openai
# Define a simple tool for the agent (e.g., a web search stub)
@function_tool
def find_articles(query: str) -> list:
# In a real scenario, this function might call an API or database.
# Here we simulate by returning static content.
return [f"Result 1 about {query}", f"Result 2 about {query}"]
@tareksanger
tareksanger / source_confidence_score.py
Created May 20, 2025 04:17
Source Confidence Score
import math
from datetime import datetime
DECAY_LAMBDA = 0.01
TYPE_MULTIPLIER = {
"primary_research": 0.8,
"secondary_research": 0.6,
"feedback": 0.4,
}
import asyncio
import logging
from typing import Dict
from lumis.agents.base import BaseAgent
from lumis.agents.graph_based_agent import GraphBasedAgent
from lumis.llm.openai_llm import LLM
from lumis.memory.simple_memory import SimpleMemory
class MyGraphPipeline(GraphBasedAgent[Dict, str]):