CubeLoop — a Pythonic, async-native agent harness core designed for high performance, readability, and production-grade persistence.
Python agent-frameworkagent-harnessagent-runtimeagentic-aiai-agentsai-frameworkanthropicharnessharness-engineeringharness-frameworklanggraphlanggraph-alternativellmmcpopenaipi-agentpi-agent-corepythonpython-agent
fix(examples): fix _provider import when loaded via uvicorn as package
xf gongee1ebbe95c34
diff --git a/examples/postgres_fastapi.py b/examples/postgres_fastapi.pyindex 4dad951..6c21150 100644--- a/examples/postgres_fastapi.py+++ b/examples/postgres_fastapi.py@@ -18,7 +18,9 @@ Set ANTHROPIC_API_KEY or OPENAI_API_KEY before running (see _provider.py).import asyncioimport os+import sysfrom contextlib import asynccontextmanager+from pathlib import Pathfrom typing import AsyncIteratorfrom fastapi import FastAPI, Depends@@ -28,6 +30,9 @@ from sse_starlette.sse import EventSourceResponsefrom cubepi import Agentfrom cubepi.checkpointer import PostgresCheckpointer+# Works both when run as a script (python examples/postgres_fastapi.py) and+# when loaded as a package by uvicorn (uvicorn examples.postgres_fastapi:app).+sys.path.insert(0, str(Path(__file__).parent))from _provider import MODEL_ID, provider_checkpointer: PostgresCheckpointer | None = None