はじめに
weave.op デコレータを付けるだけです。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Help us improve these docs. Take our quick survey.
Weave を Microsoft Azure OpenAI サービスと統合する
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}