登録して招待リンクを共有すると、動画再生報酬と紹介報酬を獲得できます。

cv usk
@cv_usk
AI / Software Research Notes AI Agent, LLMOps, MLOps, Software Architecture 投稿は個人の意見です。
参加 May 2026
280 フォロー中    415 ファン
# Useful but Little-Known Features of OpenAI Agent SDK 🌍 Ever wanted to pass provider-specific parameters that the SDK doesn't directly expose? With `extra_args`, you can add arbitrary provider-specific fields to `ModelSettings`. 📌 Title: Passing extra_args 🔗 URL: 🧩 Overview By passing a dictionary to the `extra_args` parameter of `ModelSettings`, you can send provider-specific request fields that aren't exposed as top-level SDK properties. For example, you can specify OpenAI Responses API fields like `service_tier` or `user`. This lets you use new API parameters without waiting for an SDK update. 🛠 How to use it ```python from agents import Agent, ModelSettings agent = Agent( name="English agent", instructions="You only speak English", model="gpt-4.1", model_settings=ModelSettings( temperature=0.1, extra_args={ "service_tier": "flex", "user": "user_12345", }, ), ) ``` 🏗 Building it into production ・Use `service_tier` for cost optimization (e.g., `"flex"` for cheaper low-priority batch processing) ・Set the `user` field to enable per-user tracking and abuse detection ・Adopt new API parameters immediately on release without waiting for SDK updates ・Build `extra_args` dynamically from environment variables or config files for per-environment tuning 💡 Use cases 💰 Cost reduction with `service_tier: "flex"` for batch workloads 👤 Per-user usage tracking via the `user` field 🔧 Early adoption of newly released provider features 🏢 Injecting tenant-specific parameters in multi-tenant environments ⚠️ Watch out Do not set the same request field through both a direct `ModelSettings` property and `extra_args`. Duplicate settings may cause unexpected behavior. Values passed via `extra_args` must conform to the provider's API specification, as the SDK does not validate them. ✨ With extra_args, unlock provider-specific optimizations beyond the SDK's built-in surface. #OpenAIAgentSDK# #AIAgent#
もっと見る