remove AgentMiddleware (#211)

This commit is contained in:
Kerem Yilmaz
2024-04-20 02:18:33 -07:00
committed by GitHub
parent 9091a6716e
commit 02db2a90e6
2 changed files with 3 additions and 46 deletions

View File

@@ -47,8 +47,6 @@ class Agent:
app.include_router(router, prefix="/api/v1")
app.add_middleware(AgentMiddleware, agent=self)
app.add_middleware(
RawContextMiddleware,
plugins=(
@@ -85,20 +83,6 @@ class Agent:
return app
class AgentMiddleware:
"""
Middleware that injects the agent instance into the request scope.
"""
def __init__(self, app: FastAPI, agent: Agent):
self.app = app
self.agent = agent
async def __call__(self, scope, receive, send): # type: ignore
scope["agent"] = self.agent
await self.app(scope, receive, send)
class ExecutionDatePlugin(Plugin):
key = "execution_date"