ai-helpers-yahwin 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ai_helpers/core.py ADDED
@@ -0,0 +1,9 @@
1
+ import requests
2
+ import os
3
+
4
+ def get_response(prompt):
5
+ api = os.getenv("AI_API_KEY")
6
+ headers = {"Authorization": f"Bearer {api}", "Content-Type": "application/json"}
7
+ data = {"model": "gpt-4o-mini", "messages": [{"role": "user", "content": prompt}]}
8
+ r = requests.post("https://api.openai.com/v1/chat/completions", json=data, headers=headers)
9
+ return r.json()["choices"][0]["message"]["content"]
ai_helpers/init.py ADDED
File without changes
ai_helpers/utils.py ADDED
@@ -0,0 +1,8 @@
1
+ from .core import get_response
2
+
3
+ def summarize_text(text):
4
+ prompt = "Summarize this: " + text
5
+ return get_response(prompt)
6
+
7
+ def format_response(text):
8
+ return text.strip()
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-helpers-yahwin
3
+ Version: 0.0.1
4
+ Summary: AI helper functions
5
+ Author: Your Name
6
+ License-File: LICENSE
7
+ Requires-Dist: requests
8
+ Dynamic: license-file
@@ -0,0 +1,8 @@
1
+ ai_helpers/core.py,sha256=UVO1_CPHPcbKUAFF1i3tBpJJDBRh72NI4D51lFEZxiI,420
2
+ ai_helpers/init.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ ai_helpers/utils.py,sha256=hLrGkYKw1Hc0weS_pj_6LJqE6c-vZzy2Yeu56wmvh6g,189
4
+ ai_helpers_yahwin-0.0.1.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ ai_helpers_yahwin-0.0.1.dist-info/METADATA,sha256=6CjqBfAvGxPJf2y55yOmILAwquB2LghvNzLdIfpmFV0,184
6
+ ai_helpers_yahwin-0.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ ai_helpers_yahwin-0.0.1.dist-info/top_level.txt,sha256=ez5kfMdKTGvAkvBZqUdd5DfRXPehY9VtWaGuxu1BLAI,11
8
+ ai_helpers_yahwin-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
File without changes
@@ -0,0 +1 @@
1
+ ai_helpers