nlxcaptcha
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: nlxcaptcha | ||
| Version: 1.2 | ||
| Version: 1.3 | ||
| Summary: Tell "iPad Kids" and "Non-iPad Kids" apart using OpenAI API in this easy-to-integrate captcha. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/nlckysolutions/NLX-Captcha |
+24
-24
@@ -53,33 +53,33 @@ import tkinter as tk | ||
| def verify_response(self): | ||
| user_input = self.text_entry.get("1.0", tk.END).strip() | ||
| user_input = self.text_entry.get("1.0", tk.END).strip() | ||
| system_prompt = ( | ||
| f"You are an AI tasked with identifying whether a given text was written by a child, specifically one who frequently uses an iPad or similar device." | ||
| f" Children who are considered 'iPad kids' often write with simple sentence structures, basic vocabulary, and have a casual tone." | ||
| f" The device the user is using is: {self.device}. Keep in mind that 'iPad kids' are most likely to use an iPad or a phone." | ||
| f" Be more strict if the difficulty level is high. Difficulty: {self.difficulty}/10." | ||
| f" Respond with '1' if you think the text was written by an 'iPad kid,' otherwise respond with '0'." | ||
| ) | ||
| system_prompt = ( | ||
| f"You are an AI tasked with identifying whether a given text was written by a child, specifically one who frequently uses an iPad or similar device." | ||
| f" Children who are considered 'iPad kids' often write with simple sentence structures, basic vocabulary, and have a casual tone." | ||
| f" The device the user is using is: {self.device}. Keep in mind that 'iPad kids' are most likely to use an iPad or a phone." | ||
| f" Be more strict if the difficulty level is high. Difficulty: {self.difficulty}/10." | ||
| f" Respond with '1' if you think the text was written by an 'iPad kid,' otherwise respond with '0'." | ||
| ) | ||
| response = openai.ChatCompletion.create( | ||
| model="gpt-4", | ||
| messages=[ | ||
| {"role": "system", "content": system_prompt}, | ||
| {"role": "user", "content": f"Sample: {user_input}"} | ||
| ] | ||
| ) | ||
| response = openai.ChatCompletion.create( | ||
| model="gpt-4", | ||
| messages=[ | ||
| {"role": "system", "content": system_prompt}, | ||
| {"role": "user", "content": f"Sample: {user_input}"} | ||
| ] | ||
| ) | ||
| content = response['choices'][0]['message']['content'].strip() | ||
| content = response['choices'][0]['message']['content'].strip() | ||
| # Ensure the response is either '1' or '0' | ||
| if content not in ["1", "0"]: | ||
| content = "0" # Default to '0' if the response is unexpected | ||
| # Ensure the response is either '1' or '0' | ||
| if content not in ["1", "0"]: | ||
| content = "0" # Default to '0' if the response is unexpected | ||
| self.loading.stop() | ||
| self.loading.pack_forget() | ||
| self.loading.stop() | ||
| self.loading.pack_forget() | ||
| tk.messagebox.showinfo("Verification", "Verification Successful") | ||
| self.window.destroy() | ||
| tk.messagebox.showinfo("Verification", "Verification Successful") | ||
| self.window.destroy() | ||
| self.result = content | ||
| self.result = content | ||
@@ -86,0 +86,0 @@ |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: nlxcaptcha | ||
| Version: 1.2 | ||
| Version: 1.3 | ||
| Summary: Tell "iPad Kids" and "Non-iPad Kids" apart using OpenAI API in this easy-to-integrate captcha. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/nlckysolutions/NLX-Captcha |
+1
-1
@@ -5,3 +5,3 @@ from setuptools import setup, find_packages | ||
| name='nlxcaptcha', | ||
| version='1.2', | ||
| version='1.3', | ||
| packages=find_packages(), | ||
@@ -8,0 +8,0 @@ install_requires=[ |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
6954
1.4%