Getting started
To get started using Azure with Weave, simply decorate the function(s) you want to track withweave.op.
Integrate Weave with Microsoft Azure OpenAI services
weave.op.
@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}
Was this page helpful?