forked from techiescamp/python-for-devops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (27 loc) · 750 Bytes
/
main.py
File metadata and controls
32 lines (27 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
from openai import AzureOpenAI
endpoint = "<your-endpoint>"
model_name = "o4-mini"
deployment = "o4-mini"
subscription_key = os.getenv("AZURE_OPENAI_API_KEY")
api_version = "2024-12-01-preview"
client = AzureOpenAI(
api_version=api_version,
azure_endpoint=endpoint,
api_key=subscription_key,
)
response = client.chat.completions.create(
messages=[
{
"role": "system",
"content": "You are a senior DevOps engineer helping beginners.",
},
{
"role": "user",
"content": "How do I set up CI/CD using GitHub Actions for a Node.js app?",
}
],
max_completion_tokens=100000,
model=deployment
)
print(response.choices[0].message.content)