From a0314bfa4f676f7bf30809f8115f34f1061a2c03 Mon Sep 17 00:00:00 2001 From: bsorrentino Date: Tue, 13 May 2025 15:20:49 +0000 Subject: [PATCH] feat(call_llm): add azure openai code snippet --- utils/call_llm.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/utils/call_llm.py b/utils/call_llm.py index 9259b54..d0af597 100644 --- a/utils/call_llm.py +++ b/utils/call_llm.py @@ -89,6 +89,34 @@ def call_llm(prompt: str, use_cache: bool = True) -> str: return response_text +# # Use Azure OpenAI +# def call_llm(prompt, use_cache: bool = True): +# from openai import AzureOpenAI + +# endpoint = "https://.openai.azure.com/" +# deployment = "" + +# subscription_key = "" +# api_version = "" + +# client = AzureOpenAI( +# api_version=api_version, +# azure_endpoint=endpoint, +# api_key=subscription_key, +# ) + +# r = client.chat.completions.create( +# model=deployment, +# messages=[{"role": "user", "content": prompt}], +# response_format={ +# "type": "text" +# }, +# max_completion_tokens=40000, +# reasoning_effort="medium", +# store=False +# ) +# return r.choices[0].message.content + # # Use Anthropic Claude 3.7 Sonnet Extended Thinking # def call_llm(prompt, use_cache: bool = True): # from anthropic import Anthropic