This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
from datetime import datetime | |
DECAY_LAMBDA = 0.01 | |
TYPE_MULTIPLIER = { | |
"primary_research": 0.8, | |
"secondary_research": 0.6, | |
"feedback": 0.4, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]): |