시작하기
weave.op를 데코레이터로 추가하기만 하면 됩니다.
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}