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

検索結果 métricas
métricas コミュニティ
1つのキーワードが1つのコミュニティです。
コミュニティ作成
アカウント
見つかりません
métricas を含む検索結果
# ADK 2.0の便利だけど知られていない機能 🌍 標準メトリクスだけでは測れない、自社独自の評価基準でエージェントを採点できたら理想的だと思いませんか? ADK 2.0のカスタム評価メトリクス機能は、Python関数として独自の評価ロジックを定義し、エージェントの品質を自由な基準で測定できる仕組みです。 📌 タイトル:カスタム評価メトリクス (Custom Metrics) 🔗 URL: 🧩 概要 カスタム評価メトリクスは、`EvaluationResult` を返すPython関数として定義します。関数には `eval_metric`(評価メトリクスの定義)、`actual_invocations`(実際のエージェントの応答)、`expected_invocations`(期待される応答)、`conversation_scenario`(会話シナリオ)がパラメータとして渡されます。非同期関数もサポートされており、外部サービスとの連携も可能です。 🛠 使い方 カスタムメトリクス関数を作成し、評価設定JSONに登録します。 ```python from google.adk.evaluation.eval_metrics import EvalStatus from google.adk.evaluation.evaluator import EvaluationResult async def response_length_metric( eval_metric, actual_invocations, expected_invocations, conversation_scenario ) -> EvaluationResult: # 応答の長さが適切か評価 last_response = "".join( part.text for part in actual_invocations[-1].final_response.parts ) score = 1.0 if len(last_response) < 500 else 0.5 return EvaluationResult( overall_score=score, overall_eval_status=( EvalStatus.PASSED if score >= eval_metric.criterion.threshold else EvalStatus.FAILED ), ) ``` 評価設定JSONでは、`criteria`(閾値)と `custom_metrics` の `code_config.name`(関数のインポートパス)を指定して登録します。 ```json { "criteria": { "response_length": {"threshold": 0.8} }, "custom_metrics": { "response_length": { "code_config": {"name": "my_metrics.response_length_metric"} } } } ``` 🏗 本番システムへの組み込み方 ・ドメイン固有の品質基準(正確性、トーン、コンプライアンス等)をメトリクスとして実装する ・CI/CDパイプラインでカスタムメトリクスを自動実行し、品質閾値を下回った場合にデプロイをブロックする ・非同期メトリクスを活用して、外部の評価APIやLLM-as-a-Judgeと連携する ・複数のメトリクスを組み合わせて、エージェントの総合的な品質スコアを算出する 💡 ユースケース 📏 応答の簡潔さや情報密度を独自基準で評価する 🏢 業界規制やコンプライアンス要件への準拠を自動チェックする 🎯 特定のツール呼び出しパターンが期待通りか検証する 🗣 応答のトーンや丁寧さをLLM-as-a-Judgeで自動採点する ⚠️ 注意点 カスタムメトリクス関数内で重い処理を行う場合、評価全体の実行時間に影響します。非同期関数を活用し、必要に応じてタイムアウトを設定してください。また、`code_config` のモジュールパスは評価実行環境からインポート可能である必要があります。 ✨ カスタム評価メトリクスにより、標準メトリクスではカバーしきれない独自の品質基準を体系的に運用できます。自社のユースケースに合わせた評価を構築しましょう。 #ADK# #AIAgent#
もっと見る
# Learning Palantir Foundry 🚀 "How many screens do I need to open just to understand one customer?" Object Views answer that pain by bundling everything about a single object into one screen. 📌 Title and Feature URL Title: オブジェクトビュー URL: 📝 Overview Object Views act as the central hub for everything related to a specific object. They consolidate properties, linked objects, metrics and analytics, dashboards, and operational applications into a single unified interface. For example, an Airport object view can integrate flight timelines, delay-handling workflows, and location data in one place. In practice, an Object View becomes the daily "home screen" that frontline users open to start their work. 🔧 How It Works Object Views are highly configurable by builders: - They support multiple formats and sizes, so appearance and interaction patterns can be tailored to the task. - They combine properties (attributes), linked objects, metrics, analytics, and dashboards into one display. - They can be embedded throughout the platform wherever the object appears. - Configuration happens in the Ontology Manager under the "Object views" tab, and version tabs at the top let you switch between format variations. - Selecting "Edit views" opens the configuration editor or the underlying Workshop module. - The system also supports version management, panel variations, commenting, and Marketplace product integration. 🛠 Practical Usage - In Ontology Manager, select the target object type and use the "Object views" tab to preview and configure. - Lay out core information, related objects, operation history, and embedded dashboards so everything the team needs is on one screen. - Beyond viewing, embed action types so users can trigger status changes or assignments directly from the view. - Create multiple formats to show different layouts per role (for example, sales view vs. maintenance view). 🎯 Use Cases - Customer 360: one launchpad combining transaction history, inquiries, related orders, and account owners for sales. - Equipment record: a maintenance home screen with sensor values, service history, related parts, and open tickets. - Case management: a single view of stakeholders, due dates, approval status, and next actions on a case object. ⚠️ Caveats - Views depend on the quality of the underlying ontology modeling (object types and link types); a weak foundation limits view quality. - Overloading a view confuses users, so design role-specific layouts that show only what each role needs. - Editing requires appropriate permissions to the Ontology Manager and the underlying Workshop module. #PalantirFoundry# #DataPlatform#
もっと見る
# OpenAI Agent SDKの便利で実践的な使い方 🌍 エージェントの内部で何が起きているか、可視化できていますか?ライフサイクルフックを使えば、ロギング・監査・パフォーマンス最適化をエージェントの動作に透過的に組み込めます。 RunHooks と AgentHooks で、エージェントの開始/終了、LLM 呼び出し、ツール実行、ハンドオフの各イベントにカスタムロジックを差し込めます。 📌 タイトル:Agents -- Lifecycle events (hooks) 🔗 URL: 🧩 概要 OpenAI Agent SDK には、エージェントのライフサイクルの各段階でカスタムコードを実行するためのフック機構があります。`RunHooks` はワークフロー全体に適用され、`AgentHooks` は特定のエージェントに適用されます。利用可能なフックには `on_agent_start`/`on_agent_end`、`on_llm_start`/`on_llm_end`、`on_tool_start`/`on_tool_end`、`on_handoff` があります。これらを使って、ロギング、メトリクス収集、監査証跡、データのプリフェッチなどを実装できます。 🛠 使い方 `RunHooks` を継承した `LoggingHooks` クラスを定義し、`async def on_agent_start(self, context, agent)` と `async def on_agent_end(self, context, agent, output)` をオーバーライドしてエージェントの開始・終了時にログを出力します。`Agent` を作成し、` "こんにちは", run_hooks=LoggingHooks())` の `run_hooks` 引数にフックインスタンスを渡して実行します。 🏗 実践的な使い方 **on_llm_end でアウトプットアイテム数ロギング、on_agent_end でトークン使用量ロギング** ワークフロー全体の RunHooks と特定エージェントの AgentHooks を組み合わせて、包括的な監視を実現します。 `RunHooks` を継承した `MetricsRunHooks` クラスでは、`on_agent_end` でワークフロー全体の `total_tokens` や `prompt_tokens` をロギングします。`AgentHooks` を継承した `DetailedAgentHooks` クラスでは、`on_llm_end` で `response.output` のアイテム数を記録します。`Agent` の `hooks=DetailedAgentHooks()` で特定エージェントにフックを適用し、` ..., run_hooks=MetricsRunHooks())` でワークフロー全体のフックも同時に適用して包括的な監視を実現します。 **on_tool_start の ToolContext で監査ログ・分散トレーシング** ツール実行の前後でトレース情報を記録し、問題発生時の調査を容易にします。 `AgentHooks` を継承した `AuditHooks` クラスで、`on_tool_start` では `context.context.trace_id` を取得し、` ` タイムスタンプを構造化ログに記録します。`on_tool_end` では同じ `trace_id` と ` に加え、`result is not None` で成功判定を記録し、分散トレーシングと監査ログを実現します。 **on_handoff でデータプリフェッチによるレイテンシ削減** ハンドオフ先のエージェントが必要とするデータを事前に取得しておくことで、応答速度を改善します。 `RunHooks` を継承した `PrefetchHooks` クラスの `on_handoff` で、` が `"OrderSupportAgent"` の場合に `await db.fetch_orders( と `await db.fetch_payment_methods( を事前取得し、ユーザーコンテキストに格納します。ハンドオフ先が必要なデータを先読みすることでレイテンシを削減します。 💡 ユースケース 📊 on_llm_end で LLM レスポンスのアウトプットアイテム数を記録し、出力品質の監視に活用 💰 on_agent_end でトークン使用量をロギングし、コスト管理ダッシュボードに連携 🔍 on_tool_start/end でツール実行の監査ログと分散トレーシングを自動記録 ⚡ on_handoff でハンドオフ先が必要なデータをプリフェッチし、応答レイテンシを削減 ⚠️ 注意点 - フック内で例外が発生すると、エージェントの実行自体に影響を与える可能性があります。フック内ではtry/exceptで確実にエラーを処理してください。 - フック内で重い処理を行うとエージェント全体のレイテンシが増加します。非同期 I/O やバックグラウンドタスクの活用を検討してください。 - RunHooks と AgentHooks の使い分けを意識しましょう。ワークフロー横断の監視は RunHooks、特定エージェントの詳細監視は AgentHooks が適切です。 ✨ ライフサイクルフックは、エージェントの動作を「ブラックボックス」から「完全可視化」に変えてくれます。本番運用に欠かせない監視・監査・最適化を、エージェントのロジックを汚さずに実現しましょう! #OpenAIAgentSDK# #AIAgent#
もっと見る