Last active
October 12, 2025 04:55
-
-
Save rajvermacas/6c789cf3c5001a6d67b4059bfd3f677a to your computer and use it in GitHub Desktop.
pastebin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from openai import OpenAI | |
| # Setup client | |
| client = OpenAI( | |
| api_key=os.getenv("AZURE_OPENAI_API_KEY"), | |
| base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/" | |
| ) | |
| # Send a message to o3 | |
| response = client.chat.completions.create( | |
| model="o3", # Replace with your deployment name | |
| messages=[ | |
| {"role": "user", "content": "What is 347 * 892?"} | |
| ], | |
| max_completion_tokens=5000 | |
| ) | |
| # Print the response | |
| print(response.choices[0].message.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment