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

Search results for patterns
patterns community
One keyword maps to one global community path.
Create community
People
Not Found
Tweets including patterns
Patterns of unhappy people: - Need social approval - Are reliably unreliable - Feel sorry for themselves - Choose comfort over truth - Refuse to learn from others - Spend more then they make - Use chemicals to alter mood - Make everything about them - Resent the success of others - Confuse motion with progress - Confuse cynicism with intelligence - Promiscious with their attention - Always in love with their first idea - Are alwasy too smart to look stupid - Need to learn everything from mistakes - Build a life that looks better than it feels - Protect their potential by never testing it - Stay loyal to decisions that no longer make sense - Win arguments at the expense of the relationships - Standards for others and explanations for themselves Not a good place to be.
Show more
0
34
981
110
Forward to community
Patterns I've noticed in people who aren't necessarily unhappy, but aren't going anywhere with their lives: - Never learn anything new unless they're forced to - Don't set goals unless their survival / finances make them insecure - Talk about what's happening in the world rather than what they're working on - Aren't aware of any of this, and making them aware doesn't hurts more than it helps Hard place to be.
Show more
0
242
9.1K
933
Forward to community
Patterns and designs from all over the world. [📹 brynnsmithjenkins]
Some patterns I've found useful when writing AI skills: 1. composing skills within one another. Saw this first with @mattpocockuk 's /grill-me and it has been really good for maintaining consistent behaviour 2. hiding skills behind a router. I have both /design and /testing-quality files that contain a bunch of useful skills and advice I've come across in references within the router skill 3. Freely editing skills from other devs but maintaining an UPSTREAM.md file of what I've changed so I can keep it up to date
Show more
Crypto patterns in 2026 .... The market is no longer what it used to be , current patterns are mostly traps. Therefore, do not trade based blindly on patterns. The $ETH chart is a prime example.
Show more
deco patterns of the wheeling cathedral
# Practical and Useful Patterns with ADK Deploy an agent without writing a single Dockerfile or K8s manifest? ☁️ With `adk deploy cloud_run`, your agent goes live on container serverless in one command. Add Dev UI too for seamless development and operations! ## 📌 Title Cloud Run — One-Command Container Serverless Deployment ## 🔗 URL ## 🧩 Overview ADK's Cloud Run deployment uses the `adk deploy cloud_run` command to deploy agents to a serverless environment without manual Dockerfile or manifest creation. Use `--with_ui` to bundle the Dev UI, `--session_service_uri=agentengine://` to integrate with managed sessions, and get an auto-scaling web backend ready to go. ## 🛠 How to Use Basic deployment command: ```bash adk deploy cloud_run \ --project=$GOOGLE_CLOUD_PROJECT \ --region=$GOOGLE_CLOUD_LOCATION \ $AGENT_PATH ``` Key options: - `--with_ui`: Deploy the ADK development interface alongside the API server - `--session_service_uri`: URI of the session service (pass `agentengine://` for Agent Runtime's managed sessions) - `--service_name`: Customize the Cloud Run service name - `--port`: Specify container listening port (default: 8000) Alternatively, use `gcloud run deploy` with custom Dockerfiles to embed agents in existing FastAPI applications. ## 🏗 Practical Usage - **Sharing Prototypes**: Deploy with `--with_ui` to let your team try the agent via the Dev UI - **Existing Web App Integration**: Use `gcloud run deploy` to add agent capabilities to custom FastAPI apps - **Managed Sessions**: Use `--session_service_uri=agentengine://` for Agent Runtime session management, enabling stateful conversations - **Auto-scaling**: Traffic-based auto-scaling for stable web backend operations - **Auth Control**: Choose whether to allow unauthenticated access at deploy time. For private APIs, access via `gcloud auth print-identity-token` ## 💡 Use Cases - Quickly deploying agents with Dev UI as internal tools - Adding agent features to existing FastAPI/Flask applications - Running Slack bots or chat app backends in serverless mode - Building stateful chat services with Agent Runtime managed sessions ## ⚠️ Caveats - You'll be prompted about unauthenticated access during deployment — only choose 'y' for public APIs - Consider setting minimum instances for latency-sensitive workloads to mitigate cold starts - `--with_ui` is for development — configure proper authentication for production - Default port is 8000 — use `--port` to change if it conflicts with existing services ## ✨ No Dockerfile, no manifest. One command to ship a serverless agent to the world. Experience the simplicity of Cloud Run deployment! ⚡ #ADK# #AIAgent#
Show more
# Practical and Useful Patterns for OpenAI Agent SDK 🌍 Make your agent's token spending visible. Track usage at every level -- from total cost per tenant to per-step breakdown monitoring. The Usage API lets you capture total token consumption for an entire run and drill down into per-step breakdowns for tool calls, handoffs, and guardrails. 📌 Title: Usage 🔗 URL: 🧩 Overview The OpenAI Agent SDK's Usage feature tracks token consumption across agent runs. `result.context_wrapper.usage` gives you total tokens for the entire run, while `result.context_wrapper.usage.request_usage_entries` provides per-step breakdowns (tool calls, handoffs, guardrails). You can use RunHooks' `on_agent_end` for real-time logging, and enable usage reporting for third-party model adapters with `ModelSettings(include_usage=True)`. 🛠 How to Use Create an agent with `Agent(name="Assistant", instructions="Answer user questions.")` and run `result = await "Tell me about quantum computing")`. Access total, input, and output tokens via ` `result.context_wrapper.usage.input_tokens`, and `result.context_wrapper.usage.output_tokens`. Loop through `result.context_wrapper.usage.request_usage_entries` to see per-request breakdowns with `entry.input_tokens` and `entry.output_tokens`. 🏗 Practical Usage Patterns **Per-Tenant/User Cost Calculation** Record "how much each tenant spent" for billing and budget management in SaaS applications. In a `handle_request(tenant_id, user_id, message)` function, run `result = await message)`, compute cost with `calculate_cost(model="gpt-4.1", input_tokens=result.context_wrapper.usage.input_tokens, output_tokens=result.context_wrapper.usage.output_tokens)`, and record it with `await billing_db.record(tenant_id=tenant_id, user_id=user_id, total_tokens= cost_usd=cost, timestamp= **Per-Step Monitoring** Use `request_usage_entries` to identify which tool calls or handoffs consume the most tokens. After `result = await "Generate a sales report")`, loop through `result.context_wrapper.usage.request_usage_entries` with `enumerate` to check each step's `entry.input_tokens` and `entry.output_tokens`. Flag steps where `entry.input_tokens > 5000` with a warning to identify token-heavy operations. **Real-time Logging with RunHooks** Use `on_agent_end` hook to log usage when each agent completes. Create a `UsageLoggingHooks` class extending `RunHooks` with an `on_agent_end(self, context: RunContextWrapper, agent: Agent, output)` method that reads `context.usage` and logs with `"agent_completed", agent_name= total_tokens= ...)`. Pass it via `await "question", hooks=UsageLoggingHooks())`. **Enabling Usage for Third-party Models** When using non-OpenAI model adapters, explicitly enable usage reporting. For third-party models, explicitly enable usage reporting with `Agent(name="ThirdPartyAgent", instructions="...", model=my_custom_model_adapter, model_settings=ModelSettings(include_usage=True))`. 💡 Use Cases 💰 Record per-tenant/user token consumption in a database to build usage-based billing 📊 Visualize per-step token consumption with request_usage_entries to identify cost optimization bottlenecks 🔔 Log usage via RunHooks on_agent_end for real-time dashboard monitoring 🔌 Enable ModelSettings(include_usage=True) for third-party models to ensure usage tracking coverage ⚠️ Caveats - ` includes retries and guardrail re-executions, so it may be higher than the visible step count suggests. - Third-party models may return zero usage without `include_usage=True`. Check your adapter's documentation. - Cost calculations depend on model pricing. Ensure you accurately reflect per-model input/output token rates. ✨ Track token usage at three levels -- total, per-step, and via hooks -- and you'll have cost management and quality monitoring fully covered. Start with result.context_wrapper.usage, then add step-level and hook-based tracking as needed! #OpenAIAgentSDK# #AIAgent#
Show more
# Practical and Useful Patterns with ADK Long-running tasks failing midway and restarting from scratch? That's a thing of the past! 💪 ADK's Resume Agents feature enables checkpoint-based resumption from the exact point of interruption. It supports HITL approval-pending flows too, dramatically improving agent reliability. ## 📌 Title Resume Agents — Checkpoint-Based Workflow Resumption ## 🔗 URL ## 🧩 Overview Resume Agents allows interrupted ADK workflows to continue from where they stopped rather than restarting entirely. The feature uses event logging and state preservation to track progress, enabling skipping of successful steps and seamless resumption of HITL (Human-in-the-Loop) approval-pending flows. ## 🛠 How to Use Enable resumability through `ResumabilityConfig`: Import `App` from `google.adk` and `ResumabilityConfig` from `google.adk.runtime`. Pass `resumability_config=ResumabilityConfig(is_resumable=True)` to the `App` constructor to enable checkpoint-based resumption. Also provide the `name` for the application and the `root_agent` instance. Resume by specifying the same `invocation_id`: To resume, call ` with the same `invocation_id` used during the original execution. ## 🏗 Practical Usage - **Sequential Agent**: Automatically identifies the next sub-agent to run on resume - **Loop Agent**: Continues from the last completed iteration - **Parallel Agent**: Re-executes only incomplete sub-agents - **HITL Approval Flow**: Workflows paused for human approval automatically resume after approval is granted - Custom agents extend `BaseAgentState` with checkpoints after each workflow step ## 💡 Use Cases - Recovery from failures in multi-hour data processing pipelines - Expense approval or contract review workflows requiring human sign-off - Continuing partially successful multi-step API integrations - Minimizing downtime during agent failures in production ## ⚠️ Caveats - Tools execute **at least once** and may run multiple times during resumption — ensure idempotency - Modifying workflow definitions between interruption and resume is not supported - Web UI and CLI resumption are not currently supported ## ✨ Resilient agents are a must for production workloads. Leverage Resume Agents to build workflows that gracefully survive failures! 🚀 #ADK# #AIAgent#
Show more