chore: import upstream snapshot with attribution
Code Quality / Python Lint & Format (push) Has been cancelled
Code Quality / Python Tests (push) Has been cancelled
Code Quality / JavaScript/TypeScript Lint (advisory) (push) Has been cancelled
Security Scan / CodeQL Analysis (python) (push) Has been cancelled
Security Scan / Dependency Review (push) Has been cancelled
Security Scan / CodeQL Analysis (javascript-typescript) (push) Has been cancelled
Code Quality / Python Lint & Format (push) Has been cancelled
Code Quality / Python Tests (push) Has been cancelled
Code Quality / JavaScript/TypeScript Lint (advisory) (push) Has been cancelled
Security Scan / CodeQL Analysis (python) (push) Has been cancelled
Security Scan / Dependency Review (push) Has been cancelled
Security Scan / CodeQL Analysis (javascript-typescript) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
from openai import OpenAI
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# load environment variables from .env file
|
||||
load_dotenv()
|
||||
|
||||
# configure Azure OpenAI service client
|
||||
client = OpenAI()
|
||||
deployment="gpt-4o-mini"
|
||||
|
||||
# add your completion code
|
||||
question = input("Ask your questions on python language to your study buddy: ")
|
||||
prompt = f"""
|
||||
You are an expert on the python language.
|
||||
|
||||
Whenever certain questions are asked, you need to provide response in below format.
|
||||
|
||||
- Concept
|
||||
- Example code showing the concept implementation
|
||||
- explanation of the example and how the concept is done for the user to understand better.
|
||||
|
||||
Provide answer for the question: {question}
|
||||
"""
|
||||
# make a request using the Responses API
|
||||
response = client.responses.create(model=deployment, input=prompt, store=False)
|
||||
|
||||
# print response
|
||||
print(response.output_text)
|
||||
|
||||
# very unhappy _____.
|
||||
|
||||
# Once upon a time there was a very unhappy mermaid.
|
||||
Reference in New Issue
Block a user