Register and share your invite link to earn from video plays and referrals.

Search results for CleanArchitecture
CleanArchitecture community
One keyword maps to one global community path.
Create community
People
Not Found
Tweets including CleanArchitecture
Clean Architecture sounds great... until it isn't. If your team is spending more time maintaining infrastructure than building features, it might be time for a different approach. Book a free demo with an ABP expert to see how ABP helps teams build modern, maintainable .NET applications faster. 📅 Schedule your meeting: #ABPFramework# #dotnet# #CleanArchitecture# #SoftwareArchitecture# #ASPNETCore#
Show more
This project is a really clean architecture example of software built from the ground up around LLMs. The UI is WebView running the Pipecat JavaScript client, connected to a native macOS audio transport with echo cancellation, microphone device management, etc. Audio, vision, screen, history, ui, and shell workers communicate via a bus. Workers pull messages off the bus, do LLM-ish things and drive other systems, and put messages back on the bus. I'm pretty convinced that this is more or less how all software is going to look, fairly soon.
Show more
# Practical and Useful Patterns for OpenAI Agent SDK 🌍 Inject what your agent needs with type safety! Local context lets you pass user info, loggers, and data fetchers like dependency injection. 📌 Title: Context management – Local context 🔗 URL: 🧩 Overview The OpenAI Agent SDK's local context feature provides type-safe dependency injection for agents and tools. By passing a Pydantic model or dataclass via the `context` parameter, tool functions can access user information, loggers, and external service clients. The generic type `Agent[UserInfo]` enables compile-time detection of context type mismatches. 🛠 Usage Define a `UserInfo` dataclass with `uid`, `name`, and `is_premium` fields, then use `@tool`-decorated functions that accept `ToolContext[UserInfo]`. For example, `get_recommendations(wrapper: ToolContext[UserInfo], category: str)` accesses user info via `wrapper.context` and returns premium or regular recommendations based on ` A `debug_tool` can access `wrapper.tool_name`, `wrapper.tool_call_id`, and `wrapper.tool_arguments` for debugging. Define the agent with the generic type `Agent[UserInfo]` as `Agent(name="personal_assistant", instructions="Personalize responses for the user", tools=[get_recommendations, debug_tool])`. At runtime, create `UserInfo(uid="u_12345", name="Alice", is_premium=True)` and pass it via `await "Recommend some books", context=user)`. For a more practical setup, bundle dependencies into an `AppContext` dataclass with `user: UserInfo`, `logger: logging.Logger`, `db: DatabaseClient`, and `feature_flags: dict[str, bool]`. In `fetch_order_history(wrapper: ToolContext[AppContext], limit: int = 10)`, access context via `ctx = wrapper.context`, log with ` branch on `ctx.feature_flags.get("new_order_api")`, and query with `ctx.db.get_orders(ctx.user.uid, limit)`. Define the agent as `Agent[AppContext]` with `Agent(name="order_assistant", tools=[fetch_order_history])`. 🏗 Practical Patterns The greatest value of local context is keeping tool functions as pure business logic. Instead of referencing user info or DB clients through global variables, injecting them via context dramatically improves testability — just pass a mock context in tests. `ToolContext`'s `tool_name`, `tool_call_id`, and `tool_arguments` are essential for structured logging. You can trace exactly which tool was called with which arguments, making production debugging straightforward. Using the generic type `Agent[UserInfo]` lets type checkers (mypy, etc.) detect context type mismatches. For example, passing an `AppContext` to an `Agent[UserInfo]` triggers a compile error, preventing runtime failures. Passing feature flags and configuration values through context is also effective. You can control environment-specific behavior through context values without changing code. 💡 Use Cases 👤 Personalization based on premium/free user tiers 📝 Structured logging and tracing with tool_call_id 🧪 Unit testing with mock context injection 🚩 Feature flag-driven tool behavior switching ⚠️ Caveats - Including secrets (API keys, etc.) in context risks leakage during state serialization - Context objects are shared during execution — be careful with mutable state and thread safety - `Agent[T]` generic type checking depends on static analysis tools; it's not enforced at runtime - Putting large objects (bulk data, etc.) in context degrades memory efficiency ✨ Local context enables clean-architecture, testable agents with proper dependency injection! #OpenAIAgentSDK# #AIAgent#
Show more
🚀 An ebook that takes FastAPI from your first endpoint all the way to production-scale AI systems — going deep on LLM/RAG serving, with interview questions at the end of every chapter. Title: FastAPI for AI Engineers: From First Endpoint to Production-Scale AI Systems URL: 🚀 Overview A practical guide (First Edition, 2026, by AI Engineering Insider) for AI engineers serving ML models and LLM/RAG systems in production with Python. It spans 10 chapters and 100 interview questions, woven with real-incident case studies and cost-model sidebars. ❓ Challenges Solved ・Building a model is one skill; serving it safely as a scalable production API is another ・LLM/RAG serving has its own hard parts — streaming, guardrails, cost control The book reframes FastAPI as "the de facto serving layer for AI and ML systems." 💡 Structure & Tech Covered ・Foundations: ASGI/WSGI, Uvicorn, OpenAPI, and Pydantic v2 schema separation and validation ・Implementation: idempotency, meaningful status codes, pagination, and the Router→Service→Repository clean architecture ・DB/Security: SQLAlchemy/SQLModel/Alembic, N+1, pool sizing, JWT, BOLA defense, OWASP API Top 10 ・Async: "never block the event loop," def vs async def, and httpx retries/circuit breakers 🎯 The Core (Ch.9: AI/RAG/LLM) ・Load model weights once in lifespan; offload CPU inference to a thread ・An LLM gateway centralizing auth, prompts, guardrails, and cost metering, with SSE token streaming ・Build RAG with embeddings + a vector DB (start with pgvector); validate output with Pydantic, then retry on failure ・Enforce max_tokens as a "spending limit" via the type system 📊 Highlights ・Practice-first, learning from real incidents (Netflix, Stripe, GitLab, Optus, Air Canada) ・Ch.10 covers Gunicorn+Uvicorn, K8s liveness/readiness, the three pillars of observability (p99 vs p50), and SLO-based alerting #FastAPI# #AIEngineering#
Show more