डेवलपर्स के लिए AI-असिस्टेड कोडिंग
Francesca Donadoni
AI Curriculum Manager, DataCamp

def sales_trend(self):
...
if increasing > decreasing:
return "Increasing trend"
else:
return "Decreasing or stable trend"
def sales_trend(self):
"""Analyze sales data to determine the overall trend"""
[...]
User prompt: ऐसी docstring जनरेट करें जो इस फंक्शन के लिए शामिल करे:
Model's response:
यहाँ आपकी फंक्शन के लिए पूरी docstring है:
def sales_trend(self):
"""
Analyze the sales data to determine whether there is an increasing trend
or a decreasing/stable trend over time.
[...]
"""
यहाँ आपकी फंक्शन के लिए पूरी docstring है:
def sales_trend(self):
"""
Analyze the sales data to determine whether there is an increasing trend
or a decreasing/stable trend over time.
Parameters
----------
self : object
An object that contains an attribute `daily_sales` (list of int or float),
which represents daily sales values in chronological order.
[...]
"""



आपके SalesAnalyzer क्लास के लिए एक परिष्कृत README.md ड्राफ्ट यह रहा:
SalesAnalyzer
SalesAnalyzer क्लास रोज़ाना के सेल्स डेटा का सरल विश्लेषण करने और यह पहचानने का तरीका देता है कि ट्रेंड सामान्यतः बढ़ रहा है या घट रहा/स्थिर है। यह टूल उन व्यवसायों या व्यक्तियों के लिए उपयोगी है जो समय के साथ अपने सेल्स परफॉर्मेंस का त्वरित, हाई-लेवल ओवरव्यू चाहते हैं।

(base) datacamp@test:~/datacamp/docstring-generation$ git diff
+
+ Raises:
+ ValueError: If daily_sales contains non-numeric values.
"""
- return sum(self.daily_sales)
+ if not all(isinstance(sale, (int, float)) for sale in self.daily_sales):
+ raise ValueError("All sales figures must be numeric.")
+ return sum(sale for sale in self.daily_sales)


डेवलपर्स के लिए AI-असिस्टेड कोडिंग