OpenAI API के साथ Prompt Engineering
Fouad Trad
Machine Learning Engineer

prompt = "Generate an Excel sheet containing
five student names and their grades"
print(get_response(prompt))
I'm sorry, but as a text-based AI, I am
unable to directly provide an Excel sheet.
However, I can help you generate a sample
representation of the data you requested.
prompt = "Generate a table that I can copy
to Excel, containing five student names and
their grades"
print(get_response(prompt))
| Student Name | Grade |
|--------------|-------|
| Student 1 | 90 |
| Student 2 | 85 |
| Student 3 | 95 |
| Student 4 | 88 |
| Student 5 | 92 |
code = '''
def calculate_rectangle_area(length, width):
area = length * width
return area
'''

prompt = f"""
Analyze the code delimited by triple backticks with one sentence
```{code}```.
"""
print(get_response(prompt))
The code calculates the area of a rectangle based on its length and width.
हम prompt को संशोधित करते हैं ताकि प्रोग्रामिंग भाषा मिले
prompt = f"""
Analyze the code delimited by triple backticks and provide its programming
language with one sentence
```{code}```.
"""
print(get_response(prompt))
The provided code is a function written in Python that calculates the area of a
rectangle based on its length and width.
हम prompt को संरचित आउटपुट के लिए बदलते हैं
prompt = f"""
For the function delimited by triple backticks, provide in a structured format
the following:
- description: one sentence short description
- language: the programming language used
- input: the inputs to the function
- output: the output returned by the function
```{code}```.
"""
print(get_response(prompt))
description: यह फंक्शन आयत का क्षेत्रफल निकालता है।
language: Python
input:
- length: आयत की लंबाई।
- width: आयत की चौड़ाई।
output:
- area: गणना किया गया क्षेत्रफल, जो length और width का गुणनफल है।
प्रारंभिक prompt
prompt = """
Clear skies and a gentle breeze. -> Sunny
Heavy rain and thunderstorms expected. -> Rainy
Fresh snowfall with freezing temperatures. ->
"""
print(get_response(prompt))
Snowy
प्रारंभिक prompt
prompt = """
Clear skies and a gentle breeze. -> Sunny
Heavy rain and thunderstorms expected. -> Rainy
The wind of change brought a refreshing breeze to the company's operations. ->
"""
print(get_response(prompt))
Windy
परिष्कृत prompt
prompt = """
Clear skies and a gentle breeze. -> Sunny
Heavy rain and thunderstorms expected. -> Rainy
The political climate in the country was stormy -> Unknown
The wind of change brought a refreshing breeze to the company's operations. ->
"""
print(get_response(prompt))
Unknown

OpenAI API के साथ Prompt Engineering