cognixx 1.0.0__tar.gz

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.

Potentially problematic release.


This version of cognixx might be problematic. Click here for more details.

@@ -0,0 +1,10 @@
1
+ from .main import AI, Cloud
2
+
3
+ # अगर किसी को सीधे कॉन्सटेंट चाहिए हों तो भी उपलब्ध रहेंगे
4
+ AI_URL = "https://cognixx.ai.studio/Model/AI/API/v1/chat/completions"[cite: 1]
5
+ AI_API_FREE = "cognix-2f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1GD"[cite: 1]
6
+
7
+ CLOUD_URL = "https://cognixx.ai.studio/cloud/API/v1/cognix.cloud/dev-storage/Cognix/"
8
+ CLOUD_API_FREE = "Cognix.cloud.dev-storage.cgnx_live_9a8b7c6d5e4f3a2b1c0d8f"
9
+
10
+ __all__ = ["AI", "Cloud", "AI_URL", "AI_API_FREE", "CLOUD_URL", "CLOUD_API_FREE"]
@@ -0,0 +1,119 @@
1
+ import os
2
+ import sys
3
+ import requests
4
+
5
+ # उपलब्ध मॉडल्स की लिस्ट (CLI के लिए)
6
+ AVAILABLE_MODELS = [
7
+ {"name": "Cognix Titan", "id": "Cognix/cognix-titan"},
8
+ {"name": "Cognix Coder", "id": "Cognix/cognix-coder"},
9
+ {"name": "Cognix Ultra Coder", "id": "Cognix/cognix-ultra-coder"},
10
+ {"name": "Cognix Titan Vision", "id": "Cognix/cognix-titan-vision"},
11
+ {"name": "Cognix Fast-Instruct", "id": "Cognix/cognix-fast-instruct"},
12
+ ]
13
+
14
+
15
+ def _cli_print_models():
16
+ print("\n--- Available CogniX Studio Models ---")
17
+ for idx, model in enumerate(AVAILABLE_MODELS, 1):
18
+ print(f"{idx}. {model['name']} ({model['id']})")
19
+ print("--------------------------------------\n")
20
+
21
+
22
+ class AI:
23
+ DEFAULT_URL = "https://cognixx.ai.studio/Model/AI/API/v1/chat/completions"
24
+ DEFAULT_API = "cognix-2f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1GD"
25
+ DEFAULT_MODEL = "Cognix Titan"
26
+
27
+ url = DEFAULT_URL
28
+ api = DEFAULT_API
29
+ model = DEFAULT_MODEL
30
+
31
+ def __init__(self, url=None, api=None, model=None):
32
+ self.url = url or self.url or self.DEFAULT_URL
33
+ self.api = api or self.api or self.DEFAULT_API
34
+ self.model = model or self.model or self.DEFAULT_MODEL
35
+
36
+ def chat(self, prompt, role="user"):
37
+ active_url = self.url
38
+ active_api = self.api
39
+ active_model = self.model
40
+
41
+ headers = {
42
+ "Content-Type": "application/json",
43
+ "Authorization": f"Bearer {active_api}",
44
+ }
45
+
46
+ payload = {
47
+ "model": active_model,
48
+ "messages": [{"role": role, "content": prompt}],
49
+ }
50
+
51
+ try:
52
+ response = requests.post(
53
+ active_url, headers=headers, json=payload, timeout=60
54
+ )
55
+ response.raise_for_status()
56
+ return response.json()
57
+ except requests.exceptions.RequestException as e:
58
+ return {"error": str(e)}
59
+
60
+
61
+ class Cloud:
62
+ DEFAULT_URL = (
63
+ "https://cognixx.ai.studio/cloud/API/v1/cognix.cloud/dev-storage/Cognix/"
64
+ )
65
+ DEFAULT_API = (
66
+ "Cognix.cloud.dev-storage.cgnx_live_9a8b7c6d5e4f3a2b1c0d8f"
67
+ )
68
+
69
+ url = DEFAULT_URL
70
+ api = DEFAULT_API
71
+
72
+ def __init__(self, url=None, api=None):
73
+ self.url = url or self.url or self.DEFAULT_URL
74
+ self.api = api or self.api or self.DEFAULT_API
75
+
76
+ def upload(self, file_path):
77
+ if not os.path.exists(file_path):
78
+ return {"status": "error", "message": f"फ़ाइल '{file_path}' नहीं मिली।"}
79
+
80
+ headers = {
81
+ "Authorization": f"Bearer {self.api}",
82
+ }
83
+
84
+ try:
85
+ with open(file_path, "rb") as f:
86
+ files = {"file": (os.path.basename(file_path), f)}
87
+ upload_endpoint = f"{self.url.rstrip('/')}/upload"
88
+ response = requests.post(
89
+ upload_endpoint, headers=headers, files=files, timeout=60
90
+ )
91
+ response.raise_for_status()
92
+ return response.json()
93
+ except requests.exceptions.RequestException as e:
94
+ return {"status": "error", "message": str(e)}
95
+
96
+ def fetch(self, file_id):
97
+ headers = {
98
+ "Authorization": f"Bearer {self.api}",
99
+ }
100
+
101
+ try:
102
+ fetch_endpoint = f"{self.url.rstrip('/')}/files/{file_id}"
103
+ response = requests.get(fetch_endpoint, headers=headers, timeout=60)
104
+ response.raise_for_status()
105
+ return response.json()
106
+ except requests.exceptions.RequestException as e:
107
+ return {"status": "error", "message": str(e)}
108
+
109
+
110
+ def cli():
111
+ args = sys.argv[1:]
112
+ if len(args) >= 2 and args[0].lower() == "list" and args[1].lower() == "models":
113
+ _cli_print_models()
114
+ else:
115
+ print("उपयोग: cognixx list models")
116
+
117
+
118
+ if __name__ == "__main__":
119
+ cli()
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Paras Kashyap
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
cognixx-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: cognixx
3
+ Version: 1.0.0
4
+ Summary: Python client for CogniX AI Studio and Cloud Storage Services
5
+ Home-page: https://cognixx.ai.studio
6
+ Author: Cognix Team
7
+ Author-email: ParastechIndustrieshelp@Gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE.txt
14
+ Requires-Dist: requests>=2.25.0
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license-file
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+ Dynamic: summary
25
+
26
+ # CogniX Python SDK
27
+
28
+ Official Python library for interacting with CogniX AI Studio models and Cloud services.
29
+
30
+ ## Installation
31
+
32
+ ```bash
33
+ pip install cognixx
@@ -0,0 +1,8 @@
1
+ # CogniX Python SDK
2
+
3
+ Official Python library for interacting with CogniX AI Studio models and Cloud services.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install cognixx
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: cognixx
3
+ Version: 1.0.0
4
+ Summary: Python client for CogniX AI Studio and Cloud Storage Services
5
+ Home-page: https://cognixx.ai.studio
6
+ Author: Cognix Team
7
+ Author-email: ParastechIndustrieshelp@Gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE.txt
14
+ Requires-Dist: requests>=2.25.0
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license-file
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+ Dynamic: summary
25
+
26
+ # CogniX Python SDK
27
+
28
+ Official Python library for interacting with CogniX AI Studio models and Cloud services.
29
+
30
+ ## Installation
31
+
32
+ ```bash
33
+ pip install cognixx
@@ -0,0 +1,12 @@
1
+ LICENSE.txt
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ Cognixx/__init__.py
6
+ Cognixx/main.py
7
+ cognixx.egg-info/PKG-INFO
8
+ cognixx.egg-info/SOURCES.txt
9
+ cognixx.egg-info/dependency_links.txt
10
+ cognixx.egg-info/entry_points.txt
11
+ cognixx.egg-info/requires.txt
12
+ cognixx.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ cognixx = cognixx.main:cli
@@ -0,0 +1 @@
1
+ requests>=2.25.0
@@ -0,0 +1 @@
1
+ Cognixx
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
cognixx-1.0.0/setup.py ADDED
@@ -0,0 +1,30 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open("README.md", "r", encoding="utf-8") as fh:
4
+ long_description = fh.read()
5
+
6
+ setup(
7
+ name="cognixx",
8
+ version="1.0.0",
9
+ author="Cognix Team",
10
+ author_email="ParastechIndustrieshelp@Gmail.com",
11
+ description="Python client for CogniX AI Studio and Cloud Storage Services",
12
+ long_description=long_description,
13
+ long_description_content_type="text/markdown",
14
+ url="https://cognixx.ai.studio",
15
+ packages=find_packages(),
16
+ classifiers=[
17
+ "Programming Language :: Python :: 3",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ ],
21
+ python_requires=">=3.8",
22
+ install_requires=[
23
+ "requests>=2.25.0",
24
+ ],
25
+ entry_points={
26
+ "console_scripts": [
27
+ "cognixx=cognixx.main:cli",
28
+ ],
29
+ },
30
+ )