createsonline 0.1.26__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.
- createsonline/__init__.py +46 -0
- createsonline/admin/__init__.py +7 -0
- createsonline/admin/content.py +526 -0
- createsonline/admin/crud.py +805 -0
- createsonline/admin/field_builder.py +559 -0
- createsonline/admin/integration.py +482 -0
- createsonline/admin/interface.py +2562 -0
- createsonline/admin/model_creator.py +513 -0
- createsonline/admin/model_manager.py +388 -0
- createsonline/admin/modern_dashboard.py +498 -0
- createsonline/admin/permissions.py +264 -0
- createsonline/admin/user_forms.py +594 -0
- createsonline/ai/__init__.py +202 -0
- createsonline/ai/fields.py +1226 -0
- createsonline/ai/orm.py +325 -0
- createsonline/ai/services.py +1244 -0
- createsonline/app.py +506 -0
- createsonline/auth/__init__.py +8 -0
- createsonline/auth/management.py +228 -0
- createsonline/auth/models.py +552 -0
- createsonline/cli/__init__.py +5 -0
- createsonline/cli/commands/__init__.py +122 -0
- createsonline/cli/commands/database.py +416 -0
- createsonline/cli/commands/info.py +173 -0
- createsonline/cli/commands/initdb.py +218 -0
- createsonline/cli/commands/project.py +545 -0
- createsonline/cli/commands/serve.py +173 -0
- createsonline/cli/commands/shell.py +93 -0
- createsonline/cli/commands/users.py +148 -0
- createsonline/cli/main.py +2041 -0
- createsonline/cli/manage.py +274 -0
- createsonline/config/__init__.py +9 -0
- createsonline/config/app.py +2577 -0
- createsonline/config/database.py +179 -0
- createsonline/config/docs.py +384 -0
- createsonline/config/errors.py +160 -0
- createsonline/config/orm.py +43 -0
- createsonline/config/request.py +93 -0
- createsonline/config/settings.py +176 -0
- createsonline/data/__init__.py +23 -0
- createsonline/data/dataframe.py +925 -0
- createsonline/data/io.py +453 -0
- createsonline/data/series.py +557 -0
- createsonline/database/__init__.py +60 -0
- createsonline/database/abstraction.py +440 -0
- createsonline/database/assistant.py +585 -0
- createsonline/database/fields.py +442 -0
- createsonline/database/migrations.py +132 -0
- createsonline/database/models.py +604 -0
- createsonline/database.py +438 -0
- createsonline/http/__init__.py +28 -0
- createsonline/http/client.py +535 -0
- createsonline/ml/__init__.py +55 -0
- createsonline/ml/classification.py +552 -0
- createsonline/ml/clustering.py +680 -0
- createsonline/ml/metrics.py +542 -0
- createsonline/ml/neural.py +560 -0
- createsonline/ml/preprocessing.py +784 -0
- createsonline/ml/regression.py +501 -0
- createsonline/performance/__init__.py +19 -0
- createsonline/performance/cache.py +444 -0
- createsonline/performance/compression.py +335 -0
- createsonline/performance/core.py +419 -0
- createsonline/project_init.py +789 -0
- createsonline/routing.py +528 -0
- createsonline/security/__init__.py +34 -0
- createsonline/security/core.py +811 -0
- createsonline/security/encryption.py +349 -0
- createsonline/server.py +295 -0
- createsonline/static/css/admin.css +263 -0
- createsonline/static/css/common.css +358 -0
- createsonline/static/css/dashboard.css +89 -0
- createsonline/static/favicon.ico +0 -0
- createsonline/static/icons/icon-128x128.png +0 -0
- createsonline/static/icons/icon-128x128.webp +0 -0
- createsonline/static/icons/icon-16x16.png +0 -0
- createsonline/static/icons/icon-16x16.webp +0 -0
- createsonline/static/icons/icon-180x180.png +0 -0
- createsonline/static/icons/icon-180x180.webp +0 -0
- createsonline/static/icons/icon-192x192.png +0 -0
- createsonline/static/icons/icon-192x192.webp +0 -0
- createsonline/static/icons/icon-256x256.png +0 -0
- createsonline/static/icons/icon-256x256.webp +0 -0
- createsonline/static/icons/icon-32x32.png +0 -0
- createsonline/static/icons/icon-32x32.webp +0 -0
- createsonline/static/icons/icon-384x384.png +0 -0
- createsonline/static/icons/icon-384x384.webp +0 -0
- createsonline/static/icons/icon-48x48.png +0 -0
- createsonline/static/icons/icon-48x48.webp +0 -0
- createsonline/static/icons/icon-512x512.png +0 -0
- createsonline/static/icons/icon-512x512.webp +0 -0
- createsonline/static/icons/icon-64x64.png +0 -0
- createsonline/static/icons/icon-64x64.webp +0 -0
- createsonline/static/image/android-chrome-192x192.png +0 -0
- createsonline/static/image/android-chrome-512x512.png +0 -0
- createsonline/static/image/apple-touch-icon.png +0 -0
- createsonline/static/image/favicon-16x16.png +0 -0
- createsonline/static/image/favicon-32x32.png +0 -0
- createsonline/static/image/favicon.ico +0 -0
- createsonline/static/image/favicon.svg +17 -0
- createsonline/static/image/icon-128x128.png +0 -0
- createsonline/static/image/icon-128x128.webp +0 -0
- createsonline/static/image/icon-16x16.png +0 -0
- createsonline/static/image/icon-16x16.webp +0 -0
- createsonline/static/image/icon-180x180.png +0 -0
- createsonline/static/image/icon-180x180.webp +0 -0
- createsonline/static/image/icon-192x192.png +0 -0
- createsonline/static/image/icon-192x192.webp +0 -0
- createsonline/static/image/icon-256x256.png +0 -0
- createsonline/static/image/icon-256x256.webp +0 -0
- createsonline/static/image/icon-32x32.png +0 -0
- createsonline/static/image/icon-32x32.webp +0 -0
- createsonline/static/image/icon-384x384.png +0 -0
- createsonline/static/image/icon-384x384.webp +0 -0
- createsonline/static/image/icon-48x48.png +0 -0
- createsonline/static/image/icon-48x48.webp +0 -0
- createsonline/static/image/icon-512x512.png +0 -0
- createsonline/static/image/icon-512x512.webp +0 -0
- createsonline/static/image/icon-64x64.png +0 -0
- createsonline/static/image/icon-64x64.webp +0 -0
- createsonline/static/image/logo-header-h100.png +0 -0
- createsonline/static/image/logo-header-h100.webp +0 -0
- createsonline/static/image/logo-header-h200@2x.png +0 -0
- createsonline/static/image/logo-header-h200@2x.webp +0 -0
- createsonline/static/image/logo.png +0 -0
- createsonline/static/js/admin.js +274 -0
- createsonline/static/site.webmanifest +35 -0
- createsonline/static/templates/admin/base.html +87 -0
- createsonline/static/templates/admin/dashboard.html +217 -0
- createsonline/static/templates/admin/model_form.html +270 -0
- createsonline/static/templates/admin/model_list.html +202 -0
- createsonline/static/test_script.js +15 -0
- createsonline/static/test_styles.css +59 -0
- createsonline/static_files.py +365 -0
- createsonline/templates/404.html +100 -0
- createsonline/templates/admin_login.html +169 -0
- createsonline/templates/base.html +102 -0
- createsonline/templates/index.html +151 -0
- createsonline/templates.py +205 -0
- createsonline/testing.py +322 -0
- createsonline/utils.py +448 -0
- createsonline/validation/__init__.py +49 -0
- createsonline/validation/fields.py +598 -0
- createsonline/validation/models.py +504 -0
- createsonline/validation/validators.py +561 -0
- createsonline/views.py +184 -0
- createsonline-0.1.26.dist-info/METADATA +46 -0
- createsonline-0.1.26.dist-info/RECORD +152 -0
- createsonline-0.1.26.dist-info/WHEEL +5 -0
- createsonline-0.1.26.dist-info/entry_points.txt +2 -0
- createsonline-0.1.26.dist-info/licenses/LICENSE +21 -0
- createsonline-0.1.26.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# createsonline/ai/__init__.py
|
|
2
|
+
"""
|
|
3
|
+
CREATESONLINE AI Module
|
|
4
|
+
|
|
5
|
+
Intelligent field types and AI services for CREATESONLINE applications.
|
|
6
|
+
Provides AIComputedField, LLMField, VectorField and smart AI capabilities.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
# Import main AI components
|
|
10
|
+
try:
|
|
11
|
+
from .fields import (
|
|
12
|
+
AIComputedField,
|
|
13
|
+
LLMField,
|
|
14
|
+
VectorField,
|
|
15
|
+
SmartTextField,
|
|
16
|
+
PredictionField,
|
|
17
|
+
EmbeddingField
|
|
18
|
+
)
|
|
19
|
+
from .services import (
|
|
20
|
+
OpenAIService,
|
|
21
|
+
AnthropicService,
|
|
22
|
+
LocalMLService,
|
|
23
|
+
VectorService
|
|
24
|
+
)
|
|
25
|
+
from .query import (
|
|
26
|
+
SmartQueryEngine,
|
|
27
|
+
NaturalLanguageQuery,
|
|
28
|
+
AIQueryProcessor
|
|
29
|
+
)
|
|
30
|
+
from .models import (
|
|
31
|
+
AIBaseModel,
|
|
32
|
+
IntelligentMixin
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
_AI_AVAILABLE = True
|
|
36
|
+
except ImportError as e:
|
|
37
|
+
# Graceful handling during development
|
|
38
|
+
AIComputedField = None
|
|
39
|
+
LLMField = None
|
|
40
|
+
VectorField = None
|
|
41
|
+
_AI_AVAILABLE = False
|
|
42
|
+
_IMPORT_ERROR = str(e)
|
|
43
|
+
|
|
44
|
+
# AI module metadata
|
|
45
|
+
__version__ = "0.1.0"
|
|
46
|
+
__description__ = "CREATESONLINE AI capabilities and intelligent field types"
|
|
47
|
+
|
|
48
|
+
# Default AI settings
|
|
49
|
+
DEFAULT_AI_SETTINGS = {
|
|
50
|
+
"default_llm_provider": "openai",
|
|
51
|
+
"default_llm_model": "gpt-4",
|
|
52
|
+
"default_embedding_model": "text-embedding-ada-002",
|
|
53
|
+
"vector_dimensions": 1536,
|
|
54
|
+
"batch_size": 32,
|
|
55
|
+
"max_tokens": 500,
|
|
56
|
+
"temperature": 0.7,
|
|
57
|
+
"enable_caching": True,
|
|
58
|
+
"cache_ttl": 3600, # 1 hour
|
|
59
|
+
"enable_async": True,
|
|
60
|
+
"timeout": 30
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
def is_available() -> bool:
|
|
64
|
+
"""Check if AI module is properly loaded"""
|
|
65
|
+
return _AI_AVAILABLE
|
|
66
|
+
|
|
67
|
+
def get_import_error() -> str:
|
|
68
|
+
"""Get import error if AI module failed to load"""
|
|
69
|
+
if _AI_AVAILABLE:
|
|
70
|
+
return ""
|
|
71
|
+
return getattr(globals(), '_IMPORT_ERROR', "Unknown import error")
|
|
72
|
+
|
|
73
|
+
def get_ai_info() -> dict:
|
|
74
|
+
"""Get AI module information"""
|
|
75
|
+
return {
|
|
76
|
+
"module": "createsonline.ai",
|
|
77
|
+
"version": __version__,
|
|
78
|
+
"description": __description__,
|
|
79
|
+
"available": _AI_AVAILABLE,
|
|
80
|
+
"field_types": [
|
|
81
|
+
"AIComputedField - ML predictions",
|
|
82
|
+
"LLMField - Language model generation",
|
|
83
|
+
"VectorField - Embedding storage",
|
|
84
|
+
"SmartTextField - AI-enhanced text",
|
|
85
|
+
"PredictionField - Real-time predictions",
|
|
86
|
+
"EmbeddingField - Semantic embeddings"
|
|
87
|
+
],
|
|
88
|
+
"services": [
|
|
89
|
+
"OpenAI Integration",
|
|
90
|
+
"Anthropic Claude",
|
|
91
|
+
"Local ML Models",
|
|
92
|
+
"Vector Search",
|
|
93
|
+
"Smart Query Engine"
|
|
94
|
+
],
|
|
95
|
+
"capabilities": [
|
|
96
|
+
"Natural language queries",
|
|
97
|
+
"Semantic similarity search",
|
|
98
|
+
"Content generation",
|
|
99
|
+
"Predictive analytics",
|
|
100
|
+
"Intelligent data processing",
|
|
101
|
+
"Automated insights"
|
|
102
|
+
],
|
|
103
|
+
"default_settings": DEFAULT_AI_SETTINGS
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
# AI configuration management
|
|
107
|
+
class AIConfig:
|
|
108
|
+
"""Global AI configuration for CREATESONLINE"""
|
|
109
|
+
|
|
110
|
+
def __init__(self):
|
|
111
|
+
self.settings = DEFAULT_AI_SETTINGS.copy()
|
|
112
|
+
self._services = {}
|
|
113
|
+
|
|
114
|
+
def configure(self, **kwargs):
|
|
115
|
+
"""Configure AI settings"""
|
|
116
|
+
self.settings.update(kwargs)
|
|
117
|
+
|
|
118
|
+
def get_service(self, service_type: str):
|
|
119
|
+
"""Get AI service instance"""
|
|
120
|
+
if service_type not in self._services:
|
|
121
|
+
if service_type == "openai":
|
|
122
|
+
from .services import OpenAIService
|
|
123
|
+
self._services[service_type] = OpenAIService(self.settings)
|
|
124
|
+
elif service_type == "anthropic":
|
|
125
|
+
from .services import AnthropicService
|
|
126
|
+
self._services[service_type] = AnthropicService(self.settings)
|
|
127
|
+
elif service_type == "vector":
|
|
128
|
+
from .services import VectorService
|
|
129
|
+
self._services[service_type] = VectorService(self.settings)
|
|
130
|
+
elif service_type == "local_ml":
|
|
131
|
+
from .services import LocalMLService
|
|
132
|
+
self._services[service_type] = LocalMLService(self.settings)
|
|
133
|
+
|
|
134
|
+
return self._services.get(service_type)
|
|
135
|
+
|
|
136
|
+
def reset(self):
|
|
137
|
+
"""Reset to default configuration"""
|
|
138
|
+
self.settings = DEFAULT_AI_SETTINGS.copy()
|
|
139
|
+
self._services.clear()
|
|
140
|
+
|
|
141
|
+
# Global AI configuration instance
|
|
142
|
+
ai_config = AIConfig()
|
|
143
|
+
|
|
144
|
+
# Convenience functions for quick AI operations
|
|
145
|
+
def generate_text(prompt: str, model: str = None, **kwargs) -> str:
|
|
146
|
+
"""Quick text generation using LLM"""
|
|
147
|
+
if not _AI_AVAILABLE:
|
|
148
|
+
raise ImportError("AI module not available")
|
|
149
|
+
|
|
150
|
+
service = ai_config.get_service("openai")
|
|
151
|
+
return service.generate_text(prompt, model=model, **kwargs)
|
|
152
|
+
|
|
153
|
+
def get_embedding(text: str, model: str = None) -> list:
|
|
154
|
+
"""Quick text embedding generation"""
|
|
155
|
+
if not _AI_AVAILABLE:
|
|
156
|
+
raise ImportError("AI module not available")
|
|
157
|
+
|
|
158
|
+
service = ai_config.get_service("openai")
|
|
159
|
+
return service.get_embedding(text, model=model)
|
|
160
|
+
|
|
161
|
+
def similarity_search(query: str, documents: list, top_k: int = 5) -> list:
|
|
162
|
+
"""Quick similarity search"""
|
|
163
|
+
if not _AI_AVAILABLE:
|
|
164
|
+
raise ImportError("AI module not available")
|
|
165
|
+
|
|
166
|
+
service = ai_config.get_service("vector")
|
|
167
|
+
return service.similarity_search(query, documents, top_k=top_k)
|
|
168
|
+
|
|
169
|
+
def predict(data: dict, model_name: str) -> dict:
|
|
170
|
+
"""Quick ML prediction"""
|
|
171
|
+
if not _AI_AVAILABLE:
|
|
172
|
+
raise ImportError("AI module not available")
|
|
173
|
+
|
|
174
|
+
service = ai_config.get_service("local_ml")
|
|
175
|
+
return service.predict(data, model_name)
|
|
176
|
+
|
|
177
|
+
# Export AI components
|
|
178
|
+
__all__ = [
|
|
179
|
+
'AIComputedField',
|
|
180
|
+
'LLMField',
|
|
181
|
+
'VectorField',
|
|
182
|
+
'SmartTextField',
|
|
183
|
+
'PredictionField',
|
|
184
|
+
'EmbeddingField',
|
|
185
|
+
'OpenAIService',
|
|
186
|
+
'AnthropicService',
|
|
187
|
+
'LocalMLService',
|
|
188
|
+
'VectorService',
|
|
189
|
+
'SmartQueryEngine',
|
|
190
|
+
'NaturalLanguageQuery',
|
|
191
|
+
'AIQueryProcessor',
|
|
192
|
+
'AIBaseModel',
|
|
193
|
+
'IntelligentMixin',
|
|
194
|
+
'ai_config',
|
|
195
|
+
'generate_text',
|
|
196
|
+
'get_embedding',
|
|
197
|
+
'similarity_search',
|
|
198
|
+
'predict',
|
|
199
|
+
'is_available',
|
|
200
|
+
'get_ai_info',
|
|
201
|
+
'DEFAULT_AI_SETTINGS'
|
|
202
|
+
]
|