メインコンテンツへスキップ
Weights & Biases (W&B) Weave は Microsoft Azure OpenAI サービスと統合されており、Azure AI アプリケーションの最適化を支援します。このページでは、Weave で Azure OpenAI への Call のトラッキングを開始する方法と、より高度なワークフロー向けの追加リソースを紹介します。
最新のチュートリアルについては、Microsoft Azure 上の Weights & Biases をご覧ください。

はじめに

Azure OpenAI の Call を Weave でトラッキングするには、トラッキングしたい関数に weave.op デコレータを付けるだけです。デコレータを付けると、Weave は関数の各 Call について、inputs、output、メタデータを自動的に取得します。
@weave.op()
def call_azure_chat(model_id: str, messages: list, max_tokens: int = 1000, temperature: float = 0.5):
    response = client.chat.completions.create(
        model=model_id,
        messages=messages,
        max_tokens=max_tokens,
        temperature=temperature
    )
    return {"status": "success", "response": response.choices[0].message.content}

さらに詳しく

以下のセクションでは、Weave で Azure を使用する高度なトピックについて説明します。

Weave で Azure AI Model Inference API を使用する

Weave で Azure AI Model Inference API を使用して Azure モデルへの理解を深める方法を学べます。

Weave で Azure OpenAI モデルをトレースする

Weave を使用して Azure OpenAI モデルをトレースする方法をご覧ください。