extralit-server 0.1.0a0__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.
Files changed (742) hide show
  1. argilla_server/.ipynb_checkpoints/__init__-checkpoint.py +23 -0
  2. argilla_server/.ipynb_checkpoints/settings-checkpoint.py +244 -0
  3. argilla_server/__init__.py +22 -0
  4. argilla_server/__main__.py +19 -0
  5. argilla_server/_app.py +247 -0
  6. argilla_server/_messages.py +18 -0
  7. argilla_server/_version.py +16 -0
  8. argilla_server/alembic/env.py +94 -0
  9. argilla_server/alembic/script.py.mako +24 -0
  10. argilla_server/alembic/versions/1769ee58fbb4_create_workspaces_users_table.py +47 -0
  11. argilla_server/alembic/versions/1e629a913727_fix_suggestions_type_enum_values.py +41 -0
  12. argilla_server/alembic/versions/3a8e2f9b5dea_create_questions_table.py +50 -0
  13. argilla_server/alembic/versions/3fc3c0839959_create_suggestions_table.py +70 -0
  14. argilla_server/alembic/versions/3ff6484f8b37_add_record_metadata_column.py +41 -0
  15. argilla_server/alembic/versions/74694870197c_create_users_table.py +48 -0
  16. argilla_server/alembic/versions/7552df94427a_added_document_model_and_updated_record_.py +41 -0
  17. argilla_server/alembic/versions/7850ab5b42d9_create_vectors_settings_table.py +57 -0
  18. argilla_server/alembic/versions/7cbcccf8b57a_create_metadata_properties_table.py +58 -0
  19. argilla_server/alembic/versions/82a5a88a3fa5_create_workspaces_table.py +43 -0
  20. argilla_server/alembic/versions/84f6b9ff6076_add_last_activity_at_to_datasets_table.py +44 -0
  21. argilla_server/alembic/versions/8be56284dac0_create_records_table.py +46 -0
  22. argilla_server/alembic/versions/8c574ada5e5f_update_enum_columns.py +73 -0
  23. argilla_server/alembic/versions/ae5522b4c674_create_fields_table.py +49 -0
  24. argilla_server/alembic/versions/b8458008b60e_add_allow_extra_metadata_column_to_.py +43 -0
  25. argilla_server/alembic/versions/b9099dc08489_create_datasets_table.py +49 -0
  26. argilla_server/alembic/versions/bda6fe24314e_create_vectors_table.py +57 -0
  27. argilla_server/alembic/versions/ca7293c38970_change_suggestions_score_column_to_json.py +75 -0
  28. argilla_server/alembic/versions/e402e9d9245e_create_responses_table.py +47 -0
  29. argilla_server/alembic.ini +103 -0
  30. argilla_server/apis/__init__.py +13 -0
  31. argilla_server/apis/routes.py +151 -0
  32. argilla_server/apis/v0/__init__.py +13 -0
  33. argilla_server/apis/v0/handlers/__init__.py +13 -0
  34. argilla_server/apis/v0/handlers/authentication.py +38 -0
  35. argilla_server/apis/v0/handlers/datasets.py +152 -0
  36. argilla_server/apis/v0/handlers/info.py +30 -0
  37. argilla_server/apis/v0/handlers/metrics.py +129 -0
  38. argilla_server/apis/v0/handlers/records.py +106 -0
  39. argilla_server/apis/v0/handlers/records_search.py +107 -0
  40. argilla_server/apis/v0/handlers/records_update.py +80 -0
  41. argilla_server/apis/v0/handlers/text2text.py +127 -0
  42. argilla_server/apis/v0/handlers/text_classification.py +373 -0
  43. argilla_server/apis/v0/handlers/text_classification_dataset_settings.py +136 -0
  44. argilla_server/apis/v0/handlers/token_classification.py +137 -0
  45. argilla_server/apis/v0/handlers/token_classification_dataset_settings.py +136 -0
  46. argilla_server/apis/v0/handlers/users.py +127 -0
  47. argilla_server/apis/v0/handlers/workspaces.py +123 -0
  48. argilla_server/apis/v0/helpers.py +52 -0
  49. argilla_server/apis/v0/models/__init__.py +13 -0
  50. argilla_server/apis/v0/models/commons/__init__.py +13 -0
  51. argilla_server/apis/v0/models/commons/model.py +68 -0
  52. argilla_server/apis/v0/models/commons/params.py +59 -0
  53. argilla_server/apis/v0/models/dataset_settings.py +61 -0
  54. argilla_server/apis/v0/models/text2text.py +79 -0
  55. argilla_server/apis/v0/models/text_classification.py +140 -0
  56. argilla_server/apis/v0/models/token_classification.py +78 -0
  57. argilla_server/apis/v0/validators/__init__.py +13 -0
  58. argilla_server/apis/v0/validators/commons.py +22 -0
  59. argilla_server/apis/v0/validators/text_classification.py +102 -0
  60. argilla_server/apis/v0/validators/token_classification.py +99 -0
  61. argilla_server/apis/v1/__init__.py +13 -0
  62. argilla_server/apis/v1/handlers/.DS_Store +0 -0
  63. argilla_server/apis/v1/handlers/__init__.py +13 -0
  64. argilla_server/apis/v1/handlers/authentication.py +39 -0
  65. argilla_server/apis/v1/handlers/datasets/__init__.py +27 -0
  66. argilla_server/apis/v1/handlers/datasets/datasets.py +386 -0
  67. argilla_server/apis/v1/handlers/datasets/questions.py +68 -0
  68. argilla_server/apis/v1/handlers/datasets/records.py +759 -0
  69. argilla_server/apis/v1/handlers/datasets/records_bulk.py +100 -0
  70. argilla_server/apis/v1/handlers/documents.py +206 -0
  71. argilla_server/apis/v1/handlers/fields.py +81 -0
  72. argilla_server/apis/v1/handlers/files.py +112 -0
  73. argilla_server/apis/v1/handlers/info.py +35 -0
  74. argilla_server/apis/v1/handlers/metadata_properties.py +90 -0
  75. argilla_server/apis/v1/handlers/models.py +60 -0
  76. argilla_server/apis/v1/handlers/oauth2.py +103 -0
  77. argilla_server/apis/v1/handlers/questions.py +74 -0
  78. argilla_server/apis/v1/handlers/records.py +213 -0
  79. argilla_server/apis/v1/handlers/responses.py +102 -0
  80. argilla_server/apis/v1/handlers/settings.py +25 -0
  81. argilla_server/apis/v1/handlers/suggestions.py +57 -0
  82. argilla_server/apis/v1/handlers/users.py +135 -0
  83. argilla_server/apis/v1/handlers/vectors_settings.py +67 -0
  84. argilla_server/apis/v1/handlers/workspaces.py +198 -0
  85. argilla_server/bulk/__init__.py +13 -0
  86. argilla_server/bulk/records_bulk.py +249 -0
  87. argilla_server/cli/__init__.py +18 -0
  88. argilla_server/cli/__main__.py +30 -0
  89. argilla_server/cli/database/__init__.py +18 -0
  90. argilla_server/cli/database/__main__.py +28 -0
  91. argilla_server/cli/database/migrate.py +53 -0
  92. argilla_server/cli/database/revisions.py +44 -0
  93. argilla_server/cli/database/users/__init__.py +18 -0
  94. argilla_server/cli/database/users/__main__.py +30 -0
  95. argilla_server/cli/database/users/create.py +145 -0
  96. argilla_server/cli/database/users/create_default.py +60 -0
  97. argilla_server/cli/database/users/migrate.py +117 -0
  98. argilla_server/cli/database/users/update.py +59 -0
  99. argilla_server/cli/database/users/utils.py +28 -0
  100. argilla_server/cli/database/utils.py +30 -0
  101. argilla_server/cli/rich.py +36 -0
  102. argilla_server/cli/search_engine/__init__.py +18 -0
  103. argilla_server/cli/search_engine/__main__.py +24 -0
  104. argilla_server/cli/search_engine/reindex.py +177 -0
  105. argilla_server/cli/start.py +30 -0
  106. argilla_server/cli/typer_ext.py +78 -0
  107. argilla_server/commons/__init__.py +13 -0
  108. argilla_server/commons/config.py +102 -0
  109. argilla_server/commons/models.py +33 -0
  110. argilla_server/constants.py +34 -0
  111. argilla_server/contexts/__init__.py +13 -0
  112. argilla_server/contexts/accounts.py +226 -0
  113. argilla_server/contexts/datasets.py +1289 -0
  114. argilla_server/contexts/files.py +174 -0
  115. argilla_server/contexts/info.py +55 -0
  116. argilla_server/contexts/questions.py +87 -0
  117. argilla_server/contexts/records.py +60 -0
  118. argilla_server/contexts/search.py +129 -0
  119. argilla_server/contexts/settings.py +43 -0
  120. argilla_server/daos/__init__.py +13 -0
  121. argilla_server/daos/backend/__init__.py +15 -0
  122. argilla_server/daos/backend/base.py +105 -0
  123. argilla_server/daos/backend/client_adapters/__init__.py +17 -0
  124. argilla_server/daos/backend/client_adapters/base.py +228 -0
  125. argilla_server/daos/backend/client_adapters/elasticsearch.py +127 -0
  126. argilla_server/daos/backend/client_adapters/factory.py +82 -0
  127. argilla_server/daos/backend/client_adapters/opensearch.py +748 -0
  128. argilla_server/daos/backend/generic_elastic.py +493 -0
  129. argilla_server/daos/backend/mappings/__init__.py +13 -0
  130. argilla_server/daos/backend/mappings/datasets.py +40 -0
  131. argilla_server/daos/backend/mappings/helpers.py +222 -0
  132. argilla_server/daos/backend/mappings/stopwords/__init__.py +13 -0
  133. argilla_server/daos/backend/mappings/stopwords/english.py +348 -0
  134. argilla_server/daos/backend/mappings/text2text.py +37 -0
  135. argilla_server/daos/backend/mappings/text_classification.py +55 -0
  136. argilla_server/daos/backend/mappings/token_classification.py +61 -0
  137. argilla_server/daos/backend/metrics/__init__.py +19 -0
  138. argilla_server/daos/backend/metrics/base.py +247 -0
  139. argilla_server/daos/backend/metrics/commons.py +61 -0
  140. argilla_server/daos/backend/metrics/text_classification.py +132 -0
  141. argilla_server/daos/backend/metrics/token_classification.py +229 -0
  142. argilla_server/daos/backend/query_helpers.py +360 -0
  143. argilla_server/daos/backend/search/__init__.py +13 -0
  144. argilla_server/daos/backend/search/model.py +101 -0
  145. argilla_server/daos/backend/search/query_builder.py +384 -0
  146. argilla_server/daos/datasets.py +226 -0
  147. argilla_server/daos/models/__init__.py +13 -0
  148. argilla_server/daos/models/datasets.py +93 -0
  149. argilla_server/daos/models/records.py +264 -0
  150. argilla_server/daos/records.py +263 -0
  151. argilla_server/database.py +70 -0
  152. argilla_server/enums.py +94 -0
  153. argilla_server/errors/__init__.py +16 -0
  154. argilla_server/errors/base_errors.py +200 -0
  155. argilla_server/errors/error_handler.py +110 -0
  156. argilla_server/errors/future/__init__.py +15 -0
  157. argilla_server/errors/future/base_errors.py +33 -0
  158. argilla_server/errors/task_errors.py +21 -0
  159. argilla_server/helpers.py +149 -0
  160. argilla_server/logging.py +69 -0
  161. argilla_server/models/__init__.py +20 -0
  162. argilla_server/models/base.py +34 -0
  163. argilla_server/models/database.py +488 -0
  164. argilla_server/models/metadata_properties.py +98 -0
  165. argilla_server/models/mixins.py +187 -0
  166. argilla_server/models/suggestions.py +21 -0
  167. argilla_server/policies.py +735 -0
  168. argilla_server/pydantic_v1/__init__.py +24 -0
  169. argilla_server/pydantic_v1/errors.py +18 -0
  170. argilla_server/pydantic_v1/generics.py +18 -0
  171. argilla_server/pydantic_v1/utils.py +18 -0
  172. argilla_server/schemas/__init__.py +13 -0
  173. argilla_server/schemas/base.py +41 -0
  174. argilla_server/schemas/v0/__init__.py +13 -0
  175. argilla_server/schemas/v0/authentication.py +34 -0
  176. argilla_server/schemas/v0/datasets.py +74 -0
  177. argilla_server/schemas/v0/users.py +63 -0
  178. argilla_server/schemas/v0/workspaces.py +35 -0
  179. argilla_server/schemas/v1/__init__.py +13 -0
  180. argilla_server/schemas/v1/datasets.py +102 -0
  181. argilla_server/schemas/v1/documents.py +33 -0
  182. argilla_server/schemas/v1/fields.py +94 -0
  183. argilla_server/schemas/v1/files.py +161 -0
  184. argilla_server/schemas/v1/info.py +25 -0
  185. argilla_server/schemas/v1/metadata_properties.py +186 -0
  186. argilla_server/schemas/v1/oauth2.py +32 -0
  187. argilla_server/schemas/v1/questions.py +387 -0
  188. argilla_server/schemas/v1/records.py +325 -0
  189. argilla_server/schemas/v1/records_bulk.py +55 -0
  190. argilla_server/schemas/v1/responses.py +209 -0
  191. argilla_server/schemas/v1/settings.py +42 -0
  192. argilla_server/schemas/v1/suggestions.py +101 -0
  193. argilla_server/schemas/v1/users.py +52 -0
  194. argilla_server/schemas/v1/vector_settings.py +79 -0
  195. argilla_server/schemas/v1/vectors.py +24 -0
  196. argilla_server/schemas/v1/workspaces.py +44 -0
  197. argilla_server/search_engine/__init__.py +25 -0
  198. argilla_server/search_engine/base.py +385 -0
  199. argilla_server/search_engine/commons.py +864 -0
  200. argilla_server/search_engine/elasticsearch.py +162 -0
  201. argilla_server/search_engine/opensearch.py +153 -0
  202. argilla_server/security/__init__.py +16 -0
  203. argilla_server/security/authentication/__init__.py +21 -0
  204. argilla_server/security/authentication/claims.py +31 -0
  205. argilla_server/security/authentication/db/__init__.py +18 -0
  206. argilla_server/security/authentication/db/api_key_backend.py +44 -0
  207. argilla_server/security/authentication/db/bearer_token_backend.py +47 -0
  208. argilla_server/security/authentication/jwt.py +43 -0
  209. argilla_server/security/authentication/oauth2/__init__.py +18 -0
  210. argilla_server/security/authentication/oauth2/auth_backend.py +45 -0
  211. argilla_server/security/authentication/oauth2/client_provider.py +174 -0
  212. argilla_server/security/authentication/oauth2/settings.py +103 -0
  213. argilla_server/security/authentication/oauth2/supported_providers.py +51 -0
  214. argilla_server/security/authentication/provider.py +97 -0
  215. argilla_server/security/authentication/userinfo.py +42 -0
  216. argilla_server/security/model.py +87 -0
  217. argilla_server/security/settings.py +74 -0
  218. argilla_server/server.py +13 -0
  219. argilla_server/services/__init__.py +13 -0
  220. argilla_server/services/datasets.py +245 -0
  221. argilla_server/services/info.py +107 -0
  222. argilla_server/services/metrics/__init__.py +16 -0
  223. argilla_server/services/metrics/models.py +168 -0
  224. argilla_server/services/metrics/service.py +128 -0
  225. argilla_server/services/search/__init__.py +13 -0
  226. argilla_server/services/search/model.py +67 -0
  227. argilla_server/services/search/service.py +147 -0
  228. argilla_server/services/storage/__init__.py +13 -0
  229. argilla_server/services/storage/service.py +127 -0
  230. argilla_server/services/tasks/__init__.py +13 -0
  231. argilla_server/services/tasks/commons/__init__.py +15 -0
  232. argilla_server/services/tasks/commons/models.py +42 -0
  233. argilla_server/services/tasks/text2text/__init__.py +15 -0
  234. argilla_server/services/tasks/text2text/models.py +70 -0
  235. argilla_server/services/tasks/text2text/service.py +136 -0
  236. argilla_server/services/tasks/text_classification/__init__.py +15 -0
  237. argilla_server/services/tasks/text_classification/metrics.py +172 -0
  238. argilla_server/services/tasks/text_classification/model.py +315 -0
  239. argilla_server/services/tasks/text_classification/service.py +375 -0
  240. argilla_server/services/tasks/token_classification/__init__.py +15 -0
  241. argilla_server/services/tasks/token_classification/metrics.py +394 -0
  242. argilla_server/services/tasks/token_classification/model.py +187 -0
  243. argilla_server/services/tasks/token_classification/service.py +168 -0
  244. argilla_server/settings.py +253 -0
  245. argilla_server/static/.nojekyll +0 -0
  246. argilla_server/static/200.html +9 -0
  247. argilla_server/static/README.md +11 -0
  248. argilla_server/static/_nuxt/0078330.js +1 -0
  249. argilla_server/static/_nuxt/0223eed.js +1 -0
  250. argilla_server/static/_nuxt/02fbca7.js +1 -0
  251. argilla_server/static/_nuxt/03faeb7.js +2 -0
  252. argilla_server/static/_nuxt/049a07d.js +1 -0
  253. argilla_server/static/_nuxt/05364a5.js +1 -0
  254. argilla_server/static/_nuxt/0670d3a.js +1 -0
  255. argilla_server/static/_nuxt/07a2d58.js +1 -0
  256. argilla_server/static/_nuxt/07a9cf0.js +1 -0
  257. argilla_server/static/_nuxt/0be67a0.js +1 -0
  258. argilla_server/static/_nuxt/0c2ea60.js +1 -0
  259. argilla_server/static/_nuxt/0cce6fe.js +1 -0
  260. argilla_server/static/_nuxt/0cf2041.js +1 -0
  261. argilla_server/static/_nuxt/0d09430.js +1 -0
  262. argilla_server/static/_nuxt/0dbcaf9.js +1 -0
  263. argilla_server/static/_nuxt/0e415f6.js +1 -0
  264. argilla_server/static/_nuxt/0fe3b54.js +1 -0
  265. argilla_server/static/_nuxt/100ca1a.js +2 -0
  266. argilla_server/static/_nuxt/10e8ef4.js +1 -0
  267. argilla_server/static/_nuxt/11d9ac0.js +1 -0
  268. argilla_server/static/_nuxt/12d3b93.js +1 -0
  269. argilla_server/static/_nuxt/13aa799.js +1 -0
  270. argilla_server/static/_nuxt/1411f94.js +1 -0
  271. argilla_server/static/_nuxt/1432d67.js +1 -0
  272. argilla_server/static/_nuxt/14561f7.js +1 -0
  273. argilla_server/static/_nuxt/156dbad.js +1 -0
  274. argilla_server/static/_nuxt/1650e3b.js +1 -0
  275. argilla_server/static/_nuxt/18e95c1.js +1 -0
  276. argilla_server/static/_nuxt/18f0e14.js +1 -0
  277. argilla_server/static/_nuxt/19f5f32.js +1 -0
  278. argilla_server/static/_nuxt/1c9e0af.js +1 -0
  279. argilla_server/static/_nuxt/1deb256.js +1 -0
  280. argilla_server/static/_nuxt/1f163be.js +1 -0
  281. argilla_server/static/_nuxt/220a0f2.js +1 -0
  282. argilla_server/static/_nuxt/225fc28.js +1 -0
  283. argilla_server/static/_nuxt/22bce88.js +1 -0
  284. argilla_server/static/_nuxt/2367be5.js +1 -0
  285. argilla_server/static/_nuxt/2393729.js +1 -0
  286. argilla_server/static/_nuxt/23bb6f6.js +1 -0
  287. argilla_server/static/_nuxt/2422368.js +1 -0
  288. argilla_server/static/_nuxt/243899b.js +1 -0
  289. argilla_server/static/_nuxt/2519ea1.js +1 -0
  290. argilla_server/static/_nuxt/2533a01.js +1 -0
  291. argilla_server/static/_nuxt/2563f95.js +1 -0
  292. argilla_server/static/_nuxt/263ab66.js +1 -0
  293. argilla_server/static/_nuxt/26b7bf4.js +1 -0
  294. argilla_server/static/_nuxt/26c6db5.js +1 -0
  295. argilla_server/static/_nuxt/2783d70.js +1 -0
  296. argilla_server/static/_nuxt/27e1cb6.js +1 -0
  297. argilla_server/static/_nuxt/29716c3.js +1 -0
  298. argilla_server/static/_nuxt/299cef3.js +1 -0
  299. argilla_server/static/_nuxt/2a93c84.js +1 -0
  300. argilla_server/static/_nuxt/2b29b83.js +1 -0
  301. argilla_server/static/_nuxt/2bc1e5b.js +1 -0
  302. argilla_server/static/_nuxt/2c115bd.js +1 -0
  303. argilla_server/static/_nuxt/2c6da62.js +1 -0
  304. argilla_server/static/_nuxt/2c9f828.js +1 -0
  305. argilla_server/static/_nuxt/2cdf18a.js +1 -0
  306. argilla_server/static/_nuxt/2e992bb.js +1 -0
  307. argilla_server/static/_nuxt/30a9fd6.js +1 -0
  308. argilla_server/static/_nuxt/30dfde3.js +1 -0
  309. argilla_server/static/_nuxt/32ab4a0.js +1 -0
  310. argilla_server/static/_nuxt/32bea4b.js +1 -0
  311. argilla_server/static/_nuxt/33a5297.js +1 -0
  312. argilla_server/static/_nuxt/33ae4d4.js +1 -0
  313. argilla_server/static/_nuxt/3450328.js +1 -0
  314. argilla_server/static/_nuxt/365c482.js +1 -0
  315. argilla_server/static/_nuxt/3716ffd.js +1 -0
  316. argilla_server/static/_nuxt/373f448.js +1 -0
  317. argilla_server/static/_nuxt/37c14ae.js +1 -0
  318. argilla_server/static/_nuxt/39d3e49.js +1 -0
  319. argilla_server/static/_nuxt/3b18ddc.js +1 -0
  320. argilla_server/static/_nuxt/3b657ae.js +1 -0
  321. argilla_server/static/_nuxt/3cb046d.js +1 -0
  322. argilla_server/static/_nuxt/3cfedc1.js +1 -0
  323. argilla_server/static/_nuxt/3d40531.js +1 -0
  324. argilla_server/static/_nuxt/4019208.js +1 -0
  325. argilla_server/static/_nuxt/40f1390.js +1 -0
  326. argilla_server/static/_nuxt/410ed8c.js +1 -0
  327. argilla_server/static/_nuxt/4153375.js +1 -0
  328. argilla_server/static/_nuxt/416ac85.js +1 -0
  329. argilla_server/static/_nuxt/41f9bbe.js +1 -0
  330. argilla_server/static/_nuxt/42529ee.js +1 -0
  331. argilla_server/static/_nuxt/429b9d0.js +1 -0
  332. argilla_server/static/_nuxt/43acd81.js +1 -0
  333. argilla_server/static/_nuxt/43d364b.js +1 -0
  334. argilla_server/static/_nuxt/4404d2d.js +1 -0
  335. argilla_server/static/_nuxt/4444df5.js +1 -0
  336. argilla_server/static/_nuxt/44e28f5.js +1 -0
  337. argilla_server/static/_nuxt/47ee92d.js +1 -0
  338. argilla_server/static/_nuxt/485a7a6.js +1 -0
  339. argilla_server/static/_nuxt/48b265a.js +1 -0
  340. argilla_server/static/_nuxt/4912d59.js +1 -0
  341. argilla_server/static/_nuxt/4af61db.js +1 -0
  342. argilla_server/static/_nuxt/4b0385d.js +1 -0
  343. argilla_server/static/_nuxt/4bd6608.js +1 -0
  344. argilla_server/static/_nuxt/4d07ec7.js +1 -0
  345. argilla_server/static/_nuxt/4f1b3b8.js +1 -0
  346. argilla_server/static/_nuxt/5190d93.js +1 -0
  347. argilla_server/static/_nuxt/51c25b9.js +1 -0
  348. argilla_server/static/_nuxt/521a96d.js +1 -0
  349. argilla_server/static/_nuxt/522a108.js +1 -0
  350. argilla_server/static/_nuxt/52a0567.js +1 -0
  351. argilla_server/static/_nuxt/52b70c1.js +1 -0
  352. argilla_server/static/_nuxt/53f55b3.js +1 -0
  353. argilla_server/static/_nuxt/540e27a.js +1 -0
  354. argilla_server/static/_nuxt/542eac9.js +1 -0
  355. argilla_server/static/_nuxt/56e5c4d.js +1 -0
  356. argilla_server/static/_nuxt/5abaac8.js +1 -0
  357. argilla_server/static/_nuxt/5b75dbb.js +1 -0
  358. argilla_server/static/_nuxt/5c7b140.js +1 -0
  359. argilla_server/static/_nuxt/5d93ab3.js +1 -0
  360. argilla_server/static/_nuxt/5d9502e.js +1 -0
  361. argilla_server/static/_nuxt/5f65967.js +1 -0
  362. argilla_server/static/_nuxt/63ff760.js +1 -0
  363. argilla_server/static/_nuxt/64736a5.js +2 -0
  364. argilla_server/static/_nuxt/66bcb33.js +1 -0
  365. argilla_server/static/_nuxt/66dc3c5.js +2 -0
  366. argilla_server/static/_nuxt/67120ac.js +1 -0
  367. argilla_server/static/_nuxt/67295ec.js +1 -0
  368. argilla_server/static/_nuxt/695edb6.js +1 -0
  369. argilla_server/static/_nuxt/69c7f1d.js +1 -0
  370. argilla_server/static/_nuxt/69e8ceb.js +1 -0
  371. argilla_server/static/_nuxt/6a5bf42.js +1 -0
  372. argilla_server/static/_nuxt/6ae76b5.js +1 -0
  373. argilla_server/static/_nuxt/6be200a.js +1 -0
  374. argilla_server/static/_nuxt/6cb027b.js +1 -0
  375. argilla_server/static/_nuxt/6ece027.js +1 -0
  376. argilla_server/static/_nuxt/71189f7.js +1 -0
  377. argilla_server/static/_nuxt/7280442.js +1 -0
  378. argilla_server/static/_nuxt/7408011.js +1 -0
  379. argilla_server/static/_nuxt/740a4b7.js +1 -0
  380. argilla_server/static/_nuxt/74b68ea.js +1 -0
  381. argilla_server/static/_nuxt/752070c.js +1 -0
  382. argilla_server/static/_nuxt/753c827.js +1 -0
  383. argilla_server/static/_nuxt/755a579.js +1 -0
  384. argilla_server/static/_nuxt/75f6d53.js +1 -0
  385. argilla_server/static/_nuxt/763ae3b.js +1 -0
  386. argilla_server/static/_nuxt/76b3d28.js +1 -0
  387. argilla_server/static/_nuxt/76de157.js +1 -0
  388. argilla_server/static/_nuxt/77d90de.js +1 -0
  389. argilla_server/static/_nuxt/78be624.js +2 -0
  390. argilla_server/static/_nuxt/7a63fbc.js +1 -0
  391. argilla_server/static/_nuxt/7aaea77.js +1 -0
  392. argilla_server/static/_nuxt/7b4b7e4.js +1 -0
  393. argilla_server/static/_nuxt/7b527b8.js +1 -0
  394. argilla_server/static/_nuxt/7b536fd.js +1 -0
  395. argilla_server/static/_nuxt/7e6d29f.js +1 -0
  396. argilla_server/static/_nuxt/7e910f5.js +1 -0
  397. argilla_server/static/_nuxt/7eb11d1.js +1 -0
  398. argilla_server/static/_nuxt/813f79d.js +1 -0
  399. argilla_server/static/_nuxt/8156ae2.js +1 -0
  400. argilla_server/static/_nuxt/816a020.js +1 -0
  401. argilla_server/static/_nuxt/8279c36.js +1 -0
  402. argilla_server/static/_nuxt/82d3a18.js +1 -0
  403. argilla_server/static/_nuxt/82d7363.js +1 -0
  404. argilla_server/static/_nuxt/82fbc0f.js +1 -0
  405. argilla_server/static/_nuxt/836bb89.js +1 -0
  406. argilla_server/static/_nuxt/841a001.js +1 -0
  407. argilla_server/static/_nuxt/84882ed.js +1 -0
  408. argilla_server/static/_nuxt/8554503.js +1 -0
  409. argilla_server/static/_nuxt/8568755.js +1 -0
  410. argilla_server/static/_nuxt/868bcdd.js +1 -0
  411. argilla_server/static/_nuxt/8768828.js +1 -0
  412. argilla_server/static/_nuxt/87895d0.js +1 -0
  413. argilla_server/static/_nuxt/87d4819.js +1 -0
  414. argilla_server/static/_nuxt/88a8036.js +1 -0
  415. argilla_server/static/_nuxt/88f75cb.js +1 -0
  416. argilla_server/static/_nuxt/8999162.js +1 -0
  417. argilla_server/static/_nuxt/8af4ab3.js +1 -0
  418. argilla_server/static/_nuxt/8b76631.js +1 -0
  419. argilla_server/static/_nuxt/9001b54.js +1 -0
  420. argilla_server/static/_nuxt/901ea78.js +1 -0
  421. argilla_server/static/_nuxt/9098178.js +1 -0
  422. argilla_server/static/_nuxt/93691f6.js +1 -0
  423. argilla_server/static/_nuxt/93ba5cd.js +1 -0
  424. argilla_server/static/_nuxt/94ccd58.js +1 -0
  425. argilla_server/static/_nuxt/951b133.js +1 -0
  426. argilla_server/static/_nuxt/965abef.js +1 -0
  427. argilla_server/static/_nuxt/96a813f.js +1 -0
  428. argilla_server/static/_nuxt/983be3d.js +1 -0
  429. argilla_server/static/_nuxt/98f313e.js +1 -0
  430. argilla_server/static/_nuxt/9a3dc6c.js +1 -0
  431. argilla_server/static/_nuxt/9b0111e.js +1 -0
  432. argilla_server/static/_nuxt/9b3292c.js +1 -0
  433. argilla_server/static/_nuxt/9b8f960.js +1 -0
  434. argilla_server/static/_nuxt/9c10f1e.js +1 -0
  435. argilla_server/static/_nuxt/9c335eb.js +1 -0
  436. argilla_server/static/_nuxt/9c8f81a.js +1 -0
  437. argilla_server/static/_nuxt/9d98287.js +1 -0
  438. argilla_server/static/_nuxt/9db77e3.js +1 -0
  439. argilla_server/static/_nuxt/LICENSES +108 -0
  440. argilla_server/static/_nuxt/a08cfe3.js +2 -0
  441. argilla_server/static/_nuxt/a21c12e.js +1 -0
  442. argilla_server/static/_nuxt/a2552a9.js +1 -0
  443. argilla_server/static/_nuxt/a2919e9.js +1 -0
  444. argilla_server/static/_nuxt/a496838.js +1 -0
  445. argilla_server/static/_nuxt/a4a7813.js +1 -0
  446. argilla_server/static/_nuxt/a50c4b4.js +1 -0
  447. argilla_server/static/_nuxt/a5f732b.js +1 -0
  448. argilla_server/static/_nuxt/a63a490.js +1 -0
  449. argilla_server/static/_nuxt/a63cb7f.js +1 -0
  450. argilla_server/static/_nuxt/a7b8236.js +1 -0
  451. argilla_server/static/_nuxt/a804692.js +1 -0
  452. argilla_server/static/_nuxt/a876d95.js +1 -0
  453. argilla_server/static/_nuxt/a9aa966.js +1 -0
  454. argilla_server/static/_nuxt/a9f85eb.js +1 -0
  455. argilla_server/static/_nuxt/aa1468d.js +1 -0
  456. argilla_server/static/_nuxt/af1c818.js +1 -0
  457. argilla_server/static/_nuxt/b1a021b.js +1 -0
  458. argilla_server/static/_nuxt/b2052b1.js +1 -0
  459. argilla_server/static/_nuxt/b264aac.js +1 -0
  460. argilla_server/static/_nuxt/b2d2f79.js +1 -0
  461. argilla_server/static/_nuxt/b2d8a63.js +1 -0
  462. argilla_server/static/_nuxt/b35bf58.js +1 -0
  463. argilla_server/static/_nuxt/b56fcb8.js +1 -0
  464. argilla_server/static/_nuxt/b5cf801.js +1 -0
  465. argilla_server/static/_nuxt/b63c61f.js +1 -0
  466. argilla_server/static/_nuxt/b6f7a82.js +1 -0
  467. argilla_server/static/_nuxt/b6fbc79.js +1 -0
  468. argilla_server/static/_nuxt/b716670.js +1 -0
  469. argilla_server/static/_nuxt/b762809.js +1 -0
  470. argilla_server/static/_nuxt/b7f10fc.js +1 -0
  471. argilla_server/static/_nuxt/b7f6184.js +1 -0
  472. argilla_server/static/_nuxt/b80dde7.js +1 -0
  473. argilla_server/static/_nuxt/b850396.js +1 -0
  474. argilla_server/static/_nuxt/b8a2aeb.js +1 -0
  475. argilla_server/static/_nuxt/b8cf448.js +1 -0
  476. argilla_server/static/_nuxt/b8db1e5.js +1 -0
  477. argilla_server/static/_nuxt/b940da5.js +1 -0
  478. argilla_server/static/_nuxt/b959308.js +1 -0
  479. argilla_server/static/_nuxt/bb83383.js +1 -0
  480. argilla_server/static/_nuxt/bb9ad8a.js +1 -0
  481. argilla_server/static/_nuxt/bcf2dba.js +1 -0
  482. argilla_server/static/_nuxt/bd5f3ca.js +1 -0
  483. argilla_server/static/_nuxt/bd8bbf1.js +1 -0
  484. argilla_server/static/_nuxt/bd99472.js +1 -0
  485. argilla_server/static/_nuxt/be38b31.js +1 -0
  486. argilla_server/static/_nuxt/bf8f1e2.js +1 -0
  487. argilla_server/static/_nuxt/bff3bfb.js +1 -0
  488. argilla_server/static/_nuxt/c03b049.js +1 -0
  489. argilla_server/static/_nuxt/c3a6283.js +1 -0
  490. argilla_server/static/_nuxt/c4d29a7.js +1 -0
  491. argilla_server/static/_nuxt/c53d9ef.js +1 -0
  492. argilla_server/static/_nuxt/c593e2f.js +1 -0
  493. argilla_server/static/_nuxt/c6fd838.js +1 -0
  494. argilla_server/static/_nuxt/c76f04b.js +1 -0
  495. argilla_server/static/_nuxt/c8961f6.js +1 -0
  496. argilla_server/static/_nuxt/c95c7b6.js +1 -0
  497. argilla_server/static/_nuxt/c9cdb63.js +1 -0
  498. argilla_server/static/_nuxt/ca0e624.js +1 -0
  499. argilla_server/static/_nuxt/ca93ee4.js +1 -0
  500. argilla_server/static/_nuxt/cb29a31.js +1 -0
  501. argilla_server/static/_nuxt/cb4b2da.js +1 -0
  502. argilla_server/static/_nuxt/ccb5c23.js +1 -0
  503. argilla_server/static/_nuxt/ceab509.js +1 -0
  504. argilla_server/static/_nuxt/cecc813.js +1 -0
  505. argilla_server/static/_nuxt/cfe6cd4.js +1 -0
  506. argilla_server/static/_nuxt/d15ee0b.js +1 -0
  507. argilla_server/static/_nuxt/d1f6047.js +1 -0
  508. argilla_server/static/_nuxt/d2c9f63.js +1 -0
  509. argilla_server/static/_nuxt/d3cd344.js +1 -0
  510. argilla_server/static/_nuxt/d3ff350.js +1 -0
  511. argilla_server/static/_nuxt/d453fea.js +1 -0
  512. argilla_server/static/_nuxt/d560579.js +1 -0
  513. argilla_server/static/_nuxt/d6026dd.js +1 -0
  514. argilla_server/static/_nuxt/d7209e9.js +1 -0
  515. argilla_server/static/_nuxt/d95129f.js +1 -0
  516. argilla_server/static/_nuxt/d963307.js +1 -0
  517. argilla_server/static/_nuxt/d9e9ec4.js +1 -0
  518. argilla_server/static/_nuxt/da65a1f.js +1 -0
  519. argilla_server/static/_nuxt/da6e36e.js +1 -0
  520. argilla_server/static/_nuxt/daa0abb.js +1 -0
  521. argilla_server/static/_nuxt/dc257b8.js +1 -0
  522. argilla_server/static/_nuxt/de25394.js +1 -0
  523. argilla_server/static/_nuxt/de388a0.js +1 -0
  524. argilla_server/static/_nuxt/ded5d9e.js +1 -0
  525. argilla_server/static/_nuxt/df32764.js +1 -0
  526. argilla_server/static/_nuxt/e0313f0.js +1 -0
  527. argilla_server/static/_nuxt/e041201.js +1 -0
  528. argilla_server/static/_nuxt/e08ed02.js +1 -0
  529. argilla_server/static/_nuxt/e08ed87.js +1 -0
  530. argilla_server/static/_nuxt/e11fc7d.js +1 -0
  531. argilla_server/static/_nuxt/e16a3fd.js +1 -0
  532. argilla_server/static/_nuxt/e23fa92.js +1 -0
  533. argilla_server/static/_nuxt/e2b144d.js +1 -0
  534. argilla_server/static/_nuxt/e41ab04.js +1 -0
  535. argilla_server/static/_nuxt/e71db8e.js +1 -0
  536. argilla_server/static/_nuxt/e7400e5.js +1 -0
  537. argilla_server/static/_nuxt/e84ab3f.js +1 -0
  538. argilla_server/static/_nuxt/e8c4eab.js +1 -0
  539. argilla_server/static/_nuxt/e903380.js +1 -0
  540. argilla_server/static/_nuxt/e9f4957.js +1 -0
  541. argilla_server/static/_nuxt/eb96a2f.js +1 -0
  542. argilla_server/static/_nuxt/ed4ac68.js +1 -0
  543. argilla_server/static/_nuxt/ee9cce3.js +1 -0
  544. argilla_server/static/_nuxt/ef1bf51.js +1 -0
  545. argilla_server/static/_nuxt/ef9b9ee.js +1 -0
  546. argilla_server/static/_nuxt/f006bbe.js +1 -0
  547. argilla_server/static/_nuxt/f120647.js +1 -0
  548. argilla_server/static/_nuxt/f1f7b12.js +1 -0
  549. argilla_server/static/_nuxt/f265839.js +1 -0
  550. argilla_server/static/_nuxt/f2cee33.js +1 -0
  551. argilla_server/static/_nuxt/f327cfa.js +1 -0
  552. argilla_server/static/_nuxt/f372364.js +1 -0
  553. argilla_server/static/_nuxt/f5561ff.js +1 -0
  554. argilla_server/static/_nuxt/f64eae5.js +1 -0
  555. argilla_server/static/_nuxt/f684a46.js +1 -0
  556. argilla_server/static/_nuxt/f6bcd4a.js +1 -0
  557. argilla_server/static/_nuxt/f7669f5.js +1 -0
  558. argilla_server/static/_nuxt/f77fb33.js +2 -0
  559. argilla_server/static/_nuxt/f78aa4f.js +1 -0
  560. argilla_server/static/_nuxt/f79ed6b.js +1 -0
  561. argilla_server/static/_nuxt/f9cc75d.js +1 -0
  562. argilla_server/static/_nuxt/fa98fcb.js +1 -0
  563. argilla_server/static/_nuxt/fab421a.js +1 -0
  564. argilla_server/static/_nuxt/fbd93ca.js +1 -0
  565. argilla_server/static/_nuxt/fca1274.js +1 -0
  566. argilla_server/static/_nuxt/fde98b9.js +1 -0
  567. argilla_server/static/_nuxt/fe17070.js +1 -0
  568. argilla_server/static/_nuxt/fe55041.js +1 -0
  569. argilla_server/static/_nuxt/ff5866b.js +1 -0
  570. argilla_server/static/_nuxt/fonts/raptorv2premium-bold-webfont.3c074ae.woff2 +0 -0
  571. argilla_server/static/_nuxt/fonts/raptorv2premium-bold-webfont.f7cfb4c.woff +0 -0
  572. argilla_server/static/apple-touch-icon.png +0 -0
  573. argilla_server/static/datasets/index.html +9 -0
  574. argilla_server/static/datasets/useDatasetsViewModel/index.html +9 -0
  575. argilla_server/static/favicon-16x16.png +0 -0
  576. argilla_server/static/favicon-32x32.png +0 -0
  577. argilla_server/static/favicon.ico +0 -0
  578. argilla_server/static/icons/arrow-down.svg +3 -0
  579. argilla_server/static/icons/arrow-up.svg +3 -0
  580. argilla_server/static/icons/bulk-mode.svg +8 -0
  581. argilla_server/static/icons/change-height.svg +6 -0
  582. argilla_server/static/icons/check.svg +3 -0
  583. argilla_server/static/icons/chevron-down.svg +4 -0
  584. argilla_server/static/icons/chevron-left.svg +4 -0
  585. argilla_server/static/icons/chevron-right.svg +3 -0
  586. argilla_server/static/icons/chevron-up.svg +4 -0
  587. argilla_server/static/icons/clear.svg +3 -0
  588. argilla_server/static/icons/close.svg +3 -0
  589. argilla_server/static/icons/code.svg +5 -0
  590. argilla_server/static/icons/copy.svg +3 -0
  591. argilla_server/static/icons/danger.svg +5 -0
  592. argilla_server/static/icons/discard.svg +3 -0
  593. argilla_server/static/icons/draggable.svg +8 -0
  594. argilla_server/static/icons/expand-arrows.svg +4 -0
  595. argilla_server/static/icons/exploration.svg +4 -0
  596. argilla_server/static/icons/external-link.svg +4 -0
  597. argilla_server/static/icons/external.svg +3 -0
  598. argilla_server/static/icons/filter.svg +5 -0
  599. argilla_server/static/icons/focus-mode.svg +3 -0
  600. argilla_server/static/icons/hand-labeling.svg +3 -0
  601. argilla_server/static/icons/info.svg +5 -0
  602. argilla_server/static/icons/kebab.svg +5 -0
  603. argilla_server/static/icons/link.svg +5 -0
  604. argilla_server/static/icons/log-out.svg +4 -0
  605. argilla_server/static/icons/matching.svg +4 -0
  606. argilla_server/static/icons/math-plus.svg +3 -0
  607. argilla_server/static/icons/meatballs.svg +5 -0
  608. argilla_server/static/icons/minimize-arrows.svg +4 -0
  609. argilla_server/static/icons/no-matching.svg +4 -0
  610. argilla_server/static/icons/pen.svg +4 -0
  611. argilla_server/static/icons/progress.svg +4 -0
  612. argilla_server/static/icons/refresh.svg +4 -0
  613. argilla_server/static/icons/reset.svg +3 -0
  614. argilla_server/static/icons/row-last.svg +7 -0
  615. argilla_server/static/icons/search.svg +3 -0
  616. argilla_server/static/icons/settings.svg +1 -0
  617. argilla_server/static/icons/shortcuts.svg +3 -0
  618. argilla_server/static/icons/similarity.svg +3 -0
  619. argilla_server/static/icons/smile-sad.svg +6 -0
  620. argilla_server/static/icons/sort.svg +4 -0
  621. argilla_server/static/icons/stats.svg +5 -0
  622. argilla_server/static/icons/suggestion.svg +4 -0
  623. argilla_server/static/icons/support.svg +3 -0
  624. argilla_server/static/icons/time.svg +4 -0
  625. argilla_server/static/icons/trash-empty.svg +3 -0
  626. argilla_server/static/icons/unavailable.svg +3 -0
  627. argilla_server/static/icons/validate.svg +3 -0
  628. argilla_server/static/icons/weak-labeling.svg +6 -0
  629. argilla_server/static/images/help-info/explain.png +0 -0
  630. argilla_server/static/images/help-info/similarity.png +0 -0
  631. argilla_server/static/images/logo.svg +51 -0
  632. argilla_server/static/images/welcome-hf-sign-in-ss.png +0 -0
  633. argilla_server/static/index.html +9 -0
  634. argilla_server/static/sign-in/index.html +9 -0
  635. argilla_server/static/site.webmanifest +19 -0
  636. argilla_server/static/useWelcomeHFViewModel/index.html +9 -0
  637. argilla_server/static/user-settings/index.html +9 -0
  638. argilla_server/static/welcome-hf-sign-in/index.html +9 -0
  639. argilla_server/static_rewrite.py +42 -0
  640. argilla_server/telemetry.py +136 -0
  641. argilla_server/use_cases/__init__.py +13 -0
  642. argilla_server/use_cases/responses/__init__.py +13 -0
  643. argilla_server/use_cases/responses/upsert_responses_in_bulk.py +60 -0
  644. argilla_server/utils/__init__.py +17 -0
  645. argilla_server/utils/_telemetry.py +95 -0
  646. argilla_server/utils/dependency.py +213 -0
  647. argilla_server/utils/params.py +185 -0
  648. argilla_server/utils/span_utils.py +242 -0
  649. argilla_server/utils/utils.py +42 -0
  650. argilla_server/utils.py +185 -0
  651. argilla_server/validators/__init__.py +13 -0
  652. argilla_server/validators/questions.py +155 -0
  653. argilla_server/validators/records.py +159 -0
  654. argilla_server/validators/response_values.py +270 -0
  655. argilla_server/validators/responses.py +78 -0
  656. argilla_server/validators/suggestions.py +52 -0
  657. argilla_server/validators/vectors.py +29 -0
  658. extralit/__init__.py +1 -0
  659. extralit/app.py +224 -0
  660. extralit/convert/.ipynb_checkpoints/json_table-checkpoint.py +218 -0
  661. extralit/convert/__init__.py +2 -0
  662. extralit/convert/dataset.py +51 -0
  663. extralit/convert/html_table.py +210 -0
  664. extralit/convert/json_table.py +228 -0
  665. extralit/convert/markdown.py +16 -0
  666. extralit/convert/pdf.py +57 -0
  667. extralit/convert/text.py +57 -0
  668. extralit/extraction/__init__.py +0 -0
  669. extralit/extraction/chunking.py +129 -0
  670. extralit/extraction/extraction.py +220 -0
  671. extralit/extraction/models/__init__.py +3 -0
  672. extralit/extraction/models/paper.py +119 -0
  673. extralit/extraction/models/response.py +112 -0
  674. extralit/extraction/models/schema.py +201 -0
  675. extralit/extraction/params.py +50 -0
  676. extralit/extraction/prompts.py +132 -0
  677. extralit/extraction/query.py +60 -0
  678. extralit/extraction/schema.py +231 -0
  679. extralit/extraction/staging.py +77 -0
  680. extralit/extraction/storage.py +47 -0
  681. extralit/extraction/utils.py +57 -0
  682. extralit/extraction/vector_index.py +181 -0
  683. extralit/extraction/vector_store.py +213 -0
  684. extralit/metrics/.ipynb_checkpoints/utils-checkpoint.py +107 -0
  685. extralit/metrics/__init__.py +0 -0
  686. extralit/metrics/extraction.py +210 -0
  687. extralit/metrics/grits.py +580 -0
  688. extralit/metrics/utils.py +107 -0
  689. extralit/pipeline/__init__.py +0 -0
  690. extralit/pipeline/assets/__init__.py +0 -0
  691. extralit/pipeline/export/__init__.py +0 -0
  692. extralit/pipeline/export/paper.py +209 -0
  693. extralit/pipeline/ingest/__init__.py +0 -0
  694. extralit/pipeline/ingest/paper.py +114 -0
  695. extralit/pipeline/ingest/record.py +84 -0
  696. extralit/pipeline/ingest/segment.py +92 -0
  697. extralit/pipeline/ingest/trace.py +43 -0
  698. extralit/pipeline/update/__init__.py +2 -0
  699. extralit/pipeline/update/monitor_records.py +146 -0
  700. extralit/pipeline/update/monitor_suggestion.py +147 -0
  701. extralit/pipeline/update/schema.py +49 -0
  702. extralit/pipeline/update/suggestion.py +42 -0
  703. extralit/preprocessing/__init__.py +0 -0
  704. extralit/preprocessing/document.py +285 -0
  705. extralit/preprocessing/figures.py +80 -0
  706. extralit/preprocessing/merge_segments.py +334 -0
  707. extralit/preprocessing/methods/__init__.py +0 -0
  708. extralit/preprocessing/methods/deepdoctection.py +90 -0
  709. extralit/preprocessing/methods/llmsherpa.py +95 -0
  710. extralit/preprocessing/methods/nougat.py +128 -0
  711. extralit/preprocessing/methods/unstructured.py +151 -0
  712. extralit/preprocessing/segment.py +265 -0
  713. extralit/preprocessing/tables.py +120 -0
  714. extralit/preprocessing/text.py +188 -0
  715. extralit/schema/__init__.py +6 -0
  716. extralit/schema/checks/.ipynb_checkpoints/time_elapsed-checkpoint.py +31 -0
  717. extralit/schema/checks/__init__.py +51 -0
  718. extralit/schema/checks/consistency.py +106 -0
  719. extralit/schema/checks/join.py +22 -0
  720. extralit/schema/checks/multilabels.py +24 -0
  721. extralit/schema/checks/suggestion.py +14 -0
  722. extralit/schema/checks/time_elapsed.py +33 -0
  723. extralit/schema/checks/utils.py +16 -0
  724. extralit/schema/dtypes/__init__.py +0 -0
  725. extralit/schema/dtypes/parse.py +87 -0
  726. extralit/schema/references/__init__.py +0 -0
  727. extralit/schema/references/assign.py +131 -0
  728. extralit/schema/registry.py +17 -0
  729. extralit/server/__init__.py +0 -0
  730. extralit/server/context/__init__.py +0 -0
  731. extralit/server/context/datasets.py +21 -0
  732. extralit/server/context/files.py +35 -0
  733. extralit/server/context/llamaindex.py +27 -0
  734. extralit/server/context/vectordb.py +26 -0
  735. extralit/server/models/__init__.py +0 -0
  736. extralit/server/models/extraction.py +43 -0
  737. extralit/server/models/segments.py +17 -0
  738. extralit_server-0.1.0a0.dist-info/METADATA +315 -0
  739. extralit_server-0.1.0a0.dist-info/RECORD +742 -0
  740. extralit_server-0.1.0a0.dist-info/WHEEL +4 -0
  741. extralit_server-0.1.0a0.dist-info/entry_points.txt +3 -0
  742. extralit_server-0.1.0a0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,23 @@
1
+ # coding=utf-8
2
+ # Copyright 2021-present, the Recognai S.L. team.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ import warnings
16
+
17
+ from argilla_server.pydantic_v1 import PYDANTIC_MAJOR_VERSION
18
+
19
+ if PYDANTIC_MAJOR_VERSION >= 2:
20
+ # warnings.warn("The argilla_server package is not compatible with Pydantic 2. " "Please use Pydantic 1.x instead.")
21
+ pass
22
+ else:
23
+ from argilla_server._app import app # noqa
@@ -0,0 +1,244 @@
1
+ # coding=utf-8
2
+ # Copyright 2021-present, the Recognai S.L. team.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ """
17
+ Common environment vars / settings
18
+ """
19
+ import logging
20
+ import os
21
+ import re
22
+ import warnings
23
+ from pathlib import Path
24
+ from typing import List, Optional
25
+ from urllib.parse import urlparse
26
+
27
+ from argilla_server.constants import (
28
+ DEFAULT_LABEL_SELECTION_OPTIONS_MAX_ITEMS,
29
+ DEFAULT_MAX_KEYWORD_LENGTH,
30
+ DEFAULT_SPAN_OPTIONS_MAX_ITEMS,
31
+ DEFAULT_TELEMETRY_KEY,
32
+ )
33
+ from argilla_server.pydantic_v1 import BaseSettings, Field, root_validator, validator
34
+
35
+
36
+ class Settings(BaseSettings):
37
+ """
38
+ Main application settings. The pydantic BaseSettings class makes
39
+ accessible environment variables by setting attributes.
40
+
41
+ See <https://pydantic-docs.helpmanual.io/usage/settings/>
42
+
43
+ only_bulk_api: (ONLY_BULK_API env var)
44
+ If True, activate only bulk and search endpoints
45
+
46
+ elasticseach: (ELASTICSEARCH env var)
47
+ The elasticsearch endpoint for datasets persistence
48
+
49
+ cors_origins: (CORS_ORIGINS env var)
50
+ List of host patterns for CORS origin access
51
+
52
+ docs_enabled: True
53
+ If True, enable openapi docs endpoint at /api/docs
54
+
55
+ es_records_index_shards:
56
+ Configures the number of shards for dataset records index creation. Default=1
57
+
58
+ es_records_index_replicas:
59
+ Configures the number of shard replicas for dataset records index creation. Default=0
60
+
61
+ disable_es_index_template_creation: (DISABLE_ES_INDEX_TEMPLATE_CREATION env var)
62
+ Allowing advanced users to create their own es index settings and mappings. Default=False
63
+
64
+ """
65
+
66
+ __LOGGER__ = logging.getLogger(__name__)
67
+
68
+ __DATASETS_INDEX_NAME__ = "ar.datasets"
69
+ __DATASETS_RECORDS_INDEX_NAME__ = "ar.dataset.{}"
70
+
71
+ home_path: Optional[str] = Field(description="The home path where argilla related files will be stored")
72
+ base_url: Optional[str] = Field(description="The default base url where server will be deployed")
73
+ database_url: Optional[str] = Field(description="The database url that argilla will use as data store")
74
+
75
+ s3_endpoint: Optional[str] = Field(description="The S3 endpoint for data storage")
76
+ s3_access_key: Optional[str] = Field(description="The access key for the S3 storage")
77
+ s3_secret_key: Optional[str] = Field(description="The secret key for the S3 storage")
78
+
79
+ elasticsearch: str = "http://localhost:9200"
80
+ elasticsearch_ssl_verify: bool = True
81
+ elasticsearch_ca_path: Optional[str] = None
82
+ cors_origins: List[str] = ["*"]
83
+
84
+ docs_enabled: bool = True
85
+
86
+ namespace: str = Field(default=None, regex=r"^[a-z]+$")
87
+
88
+ enable_migration: bool = Field(
89
+ default=False,
90
+ description="If enabled, try to migrate data from old rubrix installation",
91
+ )
92
+
93
+ # Analyzer configuration
94
+ default_es_search_analyzer: str = "standard"
95
+ exact_es_search_analyzer: str = "whitespace"
96
+ # This line will be enabled once words field won't be used anymore
97
+ # wordcloud_es_search_analyzer: str = "multilingual_stop_analyzer"
98
+
99
+ es_records_index_shards: int = 1
100
+ es_records_index_replicas: int = 0
101
+
102
+ es_mapping_total_fields_limit: int = 2000
103
+
104
+ search_engine: str = "elasticsearch"
105
+
106
+ vectors_fields_limit: int = Field(
107
+ default=5,
108
+ description="Max number of supported vectors per record",
109
+ )
110
+
111
+ metadata_fields_limit: int = Field(
112
+ default=50,
113
+ gt=0,
114
+ le=100,
115
+ description="Max number of fields in metadata",
116
+ )
117
+ metadata_field_length: int = Field(
118
+ default=DEFAULT_MAX_KEYWORD_LENGTH,
119
+ description="Max length supported for the string metadata fields."
120
+ " Values containing higher than this will be truncated",
121
+ )
122
+
123
+ # Questions settings
124
+ label_selection_options_max_items: int = Field(
125
+ default=DEFAULT_LABEL_SELECTION_OPTIONS_MAX_ITEMS,
126
+ description="Max number of label options for questions of type `label_selection` and `multi_label_selection`",
127
+ )
128
+
129
+ span_options_max_items: int = Field(
130
+ default=DEFAULT_SPAN_OPTIONS_MAX_ITEMS, description="Max number of label options for questions of type `span`"
131
+ )
132
+
133
+ # See also the telemetry.py module
134
+ enable_telemetry: bool = True
135
+ telemetry_key: str = DEFAULT_TELEMETRY_KEY
136
+
137
+ @validator("home_path", always=True)
138
+ def set_home_path_default(cls, home_path: str):
139
+ return home_path or os.path.join(Path.home(), ".argilla")
140
+
141
+ @validator("base_url", always=True)
142
+ def normalize_base_url(cls, base_url: str):
143
+ if not base_url:
144
+ base_url = "/"
145
+ if not base_url.startswith("/"):
146
+ base_url = "/" + base_url
147
+ if not base_url.endswith("/"):
148
+ base_url += "/"
149
+
150
+ return base_url
151
+
152
+ @validator("database_url", pre=True, always=True)
153
+ def set_database_url(cls, database_url: str, values: dict) -> str:
154
+ if not database_url:
155
+ database_url = os.getenv("ARGILLA_DATABASE_URL")
156
+
157
+ if not database_url:
158
+ postgres_password = os.getenv("POSTGRES_PASSWORD")
159
+ postgres_host = os.getenv("POSTGRES_HOST")
160
+
161
+ if not postgres_password or not postgres_host:
162
+ warnings.warn("ARGILLA_DATABASE_URL or POSTGRES_PASSWORD and POSTGRES_HOST environment variables are "
163
+ "not set properly, so certain configurations to argilla server may not work as expected.")
164
+ database_url = f"postgresql+asyncpg://postgres:{postgres_password}@{postgres_host}/postgres"
165
+
166
+ if "sqlite" in database_url:
167
+ regex = re.compile(r"sqlite(?!\+aiosqlite)")
168
+ if regex.match(database_url):
169
+ warnings.warn(
170
+ "From version 1.14.0, Argilla will use `aiosqlite` as default SQLite driver. The protocol in the"
171
+ " provided database URL has been automatically replaced from `sqlite` to `sqlite+aiosqlite`."
172
+ " Please, update your database URL to use `sqlite+aiosqlite` protocol."
173
+ )
174
+ return re.sub(regex, "sqlite+aiosqlite", database_url)
175
+
176
+ if "postgresql" in database_url:
177
+ regex = re.compile(r"postgresql(?!\+asyncpg)(\+psycopg2)?")
178
+ if regex.match(database_url):
179
+ warnings.warn(
180
+ "From version 1.14.0, Argilla will use `asyncpg` as default PostgreSQL driver. The protocol in the"
181
+ " provided database URL has been automatically replaced from `postgresql` to `postgresql+asyncpg`."
182
+ " Please, update your database URL to use `postgresql+asyncpg` protocol."
183
+ )
184
+ return re.sub(regex, "postgresql+asyncpg", database_url)
185
+
186
+ return database_url
187
+
188
+ @root_validator(pre=True)
189
+ def set_s3_credentials(cls, values):
190
+ print('set_s3_credentials', values)
191
+ values["s3_endpoint"] = os.getenv("S3_ENDPOINT", values.get("s3_endpoint"))
192
+ values["s3_access_key"] = os.getenv("S3_ACCESS_KEY", values.get("s3_access_key"))
193
+ values["s3_secret_key"] = os.getenv("S3_SECRET_KEY", values.get("s3_secret_key"))
194
+
195
+ return values
196
+
197
+ @root_validator(skip_on_failure=True)
198
+ def create_home_path(cls, values):
199
+ Path(values["home_path"]).mkdir(parents=True, exist_ok=True)
200
+
201
+ return values
202
+
203
+ @property
204
+ def dataset_index_name(self) -> str:
205
+ ns = self.namespace
206
+ if ns:
207
+ return f"{self.namespace}.{self.__DATASETS_INDEX_NAME__}"
208
+ return self.__DATASETS_INDEX_NAME__
209
+
210
+ @property
211
+ def dataset_records_index_name(self) -> str:
212
+ ns = self.namespace
213
+ if ns:
214
+ return f"{self.namespace}.{self.__DATASETS_RECORDS_INDEX_NAME__}"
215
+ return self.__DATASETS_RECORDS_INDEX_NAME__
216
+
217
+ @property
218
+ def old_dataset_index_name(self) -> str:
219
+ index_name = ".rubrix<NAMESPACE>.datasets-v0"
220
+ ns = self.namespace
221
+ if ns is None:
222
+ return index_name.replace("<NAMESPACE>", "")
223
+ return index_name.replace("<NAMESPACE>", f".{ns}")
224
+
225
+ @property
226
+ def old_dataset_records_index_name(self) -> str:
227
+ index_name = ".rubrix<NAMESPACE>.dataset.{}.records-v0"
228
+ ns = self.namespace
229
+ if ns is None:
230
+ return index_name.replace("<NAMESPACE>", "")
231
+ return index_name.replace("<NAMESPACE>", f".{ns}")
232
+
233
+ def obfuscated_elasticsearch(self) -> str:
234
+ """Returns configured elasticsearch url obfuscating the provided password, if any"""
235
+ parsed = urlparse(self.elasticsearch)
236
+ if parsed.password:
237
+ return self.elasticsearch.replace(parsed.password, "XXXX")
238
+ return self.elasticsearch
239
+
240
+ class Config:
241
+ env_prefix = "ARGILLA_"
242
+
243
+
244
+ settings = Settings()
@@ -0,0 +1,22 @@
1
+ # coding=utf-8
2
+ # Copyright 2021-present, the Recognai S.L. team.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ import warnings
16
+
17
+ from argilla_server.pydantic_v1 import PYDANTIC_MAJOR_VERSION
18
+
19
+ if PYDANTIC_MAJOR_VERSION >= 2:
20
+ warnings.warn("The argilla_server package is not compatible with Pydantic 2. " "Please use Pydantic 1.x instead.")
21
+ else:
22
+ from argilla_server._app import app # noqa
@@ -0,0 +1,19 @@
1
+ # coding=utf-8
2
+ # Copyright 2021-present, the Recognai S.L. team.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from argilla_server.cli import app
17
+
18
+ if __name__ == "__main__":
19
+ app()
argilla_server/_app.py ADDED
@@ -0,0 +1,247 @@
1
+ # coding=utf-8
2
+ # Copyright 2021-present, the Recognai S.L. team.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ import contextlib
16
+ import glob
17
+ import inspect
18
+ import logging
19
+ import os
20
+ import shutil
21
+ import tempfile
22
+ from pathlib import Path
23
+
24
+ import backoff
25
+ from brotli_asgi import BrotliMiddleware
26
+ from fastapi import FastAPI
27
+ from starlette.middleware.cors import CORSMiddleware
28
+ from starlette.responses import RedirectResponse
29
+
30
+ from argilla_server import helpers
31
+ from argilla_server._version import __version__ as argilla_version
32
+ from argilla_server.apis.routes import api_v0, api_v1
33
+ from argilla_server.constants import DEFAULT_API_KEY, DEFAULT_PASSWORD, DEFAULT_USERNAME
34
+ from argilla_server.contexts import accounts
35
+ from argilla_server.daos.backend import GenericElasticEngineBackend
36
+ from argilla_server.daos.backend.base import GenericSearchError
37
+ from argilla_server.daos.datasets import DatasetsDAO
38
+ from argilla_server.daos.records import DatasetRecordsDAO
39
+ from argilla_server.database import get_async_db
40
+ from argilla_server.logging import configure_logging
41
+ from argilla_server.models import User
42
+ from argilla_server.pydantic_v1.errors import ConfigError
43
+ from argilla_server.security import auth
44
+ from argilla_server.settings import settings
45
+ from argilla_server.static_rewrite import RewriteStaticFiles
46
+
47
+ _LOGGER = logging.getLogger("argilla")
48
+
49
+
50
+ def create_server_app() -> FastAPI:
51
+ """Configure the argilla server"""
52
+
53
+ app = FastAPI(
54
+ title="Argilla",
55
+ description="Argilla API",
56
+ docs_url=None,
57
+ redoc_url=None,
58
+ version=str(argilla_version),
59
+ )
60
+
61
+ @app.get("/docs", include_in_schema=False)
62
+ async def redirect_docs():
63
+ return RedirectResponse(url=f"{settings.base_url}api/docs")
64
+
65
+ @app.get("/api", include_in_schema=False)
66
+ async def redirect_api():
67
+ return RedirectResponse(url=f"{settings.base_url}api/docs")
68
+
69
+ for app_configure in [
70
+ configure_app_logging,
71
+ configure_database,
72
+ configure_storage,
73
+ configure_telemetry,
74
+ configure_middleware,
75
+ configure_app_security,
76
+ configure_api_router,
77
+ configure_app_statics,
78
+ ]:
79
+ app_configure(app)
80
+
81
+ # This if-else clause is needed to simplify the test dependencies setup. Otherwise we cannot override dependencies
82
+ # easily. We can review this once we have separate fastapi application for the api and the webapp.
83
+ if settings.base_url and settings.base_url != "/":
84
+ _app = FastAPI(docs_url=None, redoc_url=None, openapi_url=None)
85
+ _app.mount(settings.base_url, app)
86
+ return _app
87
+ else:
88
+ return app
89
+
90
+
91
+ def configure_middleware(app: FastAPI):
92
+ """Configures fastapi middleware"""
93
+
94
+ app.add_middleware(
95
+ CORSMiddleware,
96
+ allow_origins=settings.cors_origins,
97
+ allow_credentials=True,
98
+ allow_methods=["*"],
99
+ allow_headers=["*"],
100
+ )
101
+
102
+ app.add_middleware(BrotliMiddleware, minimum_size=512, quality=7)
103
+
104
+
105
+ def configure_api_router(app: FastAPI):
106
+ """Configures and set the api router to app"""
107
+ app.mount("/api/v1", api_v1)
108
+ app.mount("/api", api_v0)
109
+
110
+
111
+ def configure_app_statics(app: FastAPI):
112
+ """Configure static folder for app"""
113
+
114
+ parent_path = Path(__file__).parent.absolute()
115
+ statics_folder = Path(os.path.join(parent_path, "static"))
116
+ if not (statics_folder.exists() and statics_folder.is_dir()):
117
+ return
118
+
119
+ def _create_statics_folder(path_from):
120
+ """
121
+ Application statics will be created with a parameterized baseUrl variable.
122
+
123
+ This function will replace the variable by the real runtime value found in settings.base_url
124
+
125
+ This allow us to deploy the argilla server under a custom base url, even when webapp does not
126
+ support it.
127
+
128
+ """
129
+ BASE_URL_VAR_NAME = "@@baseUrl@@"
130
+ temp_dir = tempfile.mkdtemp()
131
+ new_folder = shutil.copytree(path_from, temp_dir + "/statics")
132
+ base_url = helpers.remove_suffix(settings.base_url, suffix="/")
133
+ for extension in ["*.js", "*.html"]:
134
+ for file in glob.glob(
135
+ f"{new_folder}/**/{extension}",
136
+ recursive=True,
137
+ ):
138
+ helpers.replace_string_in_file(
139
+ file,
140
+ string=BASE_URL_VAR_NAME,
141
+ replace_by=base_url,
142
+ )
143
+
144
+ return new_folder
145
+
146
+ temp_statics = _create_statics_folder(statics_folder)
147
+
148
+ app.mount(
149
+ "/",
150
+ RewriteStaticFiles(directory=temp_statics, html=True, check_dir=False),
151
+ name="static",
152
+ )
153
+
154
+
155
+ def configure_storage(app: FastAPI):
156
+ def _on_backoff(event):
157
+ _LOGGER.warning(
158
+ f"Connection to {settings.obfuscated_elasticsearch()} is not ready. "
159
+ f"Tried {event['tries']} times. Retrying..."
160
+ )
161
+
162
+ @backoff.on_exception(
163
+ lambda: backoff.constant(interval=15),
164
+ ConfigError,
165
+ max_time=60,
166
+ on_backoff=_on_backoff,
167
+ )
168
+ def _setup_elasticsearch():
169
+ try:
170
+ backend = GenericElasticEngineBackend.get_instance()
171
+ dataset_records: DatasetRecordsDAO = DatasetRecordsDAO(backend)
172
+ datasets: DatasetsDAO = DatasetsDAO.get_instance(
173
+ es=backend,
174
+ records_dao=dataset_records,
175
+ )
176
+ datasets.init()
177
+ dataset_records.init()
178
+ except GenericSearchError as error:
179
+ raise ConfigError(
180
+ f"Your Elasticsearch endpoint at {settings.obfuscated_elasticsearch()} "
181
+ "is not available or not responding.\n"
182
+ "Please make sure your Elasticsearch instance is launched and correctly running and\n"
183
+ "you have the necessary access permissions. "
184
+ "Once you have verified this, restart the argilla server.\n"
185
+ ) from error
186
+
187
+ @app.on_event("startup")
188
+ async def setup_elasticsearch():
189
+ _setup_elasticsearch()
190
+
191
+
192
+ def configure_app_security(app: FastAPI):
193
+ auth.configure_app(app)
194
+
195
+
196
+ def configure_app_logging(app: FastAPI):
197
+ """Configure app logging using"""
198
+ app.on_event("startup")(configure_logging)
199
+
200
+
201
+ def configure_telemetry(app: FastAPI):
202
+ message = "\n"
203
+ message += inspect.cleandoc(
204
+ """
205
+ Argilla uses telemetry to report anonymous usage and error information.
206
+
207
+ You can know more about what information is reported at:
208
+
209
+ https://docs.argilla.io/en/latest/reference/telemetry.html
210
+
211
+ Telemetry is currently enabled. If you want to disable it, you can configure
212
+ the environment variable before relaunching the server:
213
+ """
214
+ )
215
+ message += "\n\n "
216
+ message += "#set ARGILLA_ENABLE_TELEMETRY=0" if os.name == "nt" else "$>export ARGILLA_ENABLE_TELEMETRY=0"
217
+ message += "\n"
218
+
219
+ @app.on_event("startup")
220
+ async def check_telemetry():
221
+ if settings.enable_telemetry:
222
+ print(message, flush=True)
223
+
224
+
225
+ _get_db_wrapper = contextlib.asynccontextmanager(get_async_db)
226
+
227
+
228
+ def configure_database(app: FastAPI):
229
+ def _user_has_default_credentials(user: User):
230
+ return user.api_key == DEFAULT_API_KEY or accounts.verify_password(DEFAULT_PASSWORD, user.password_hash)
231
+
232
+ def _log_default_user_warning():
233
+ _LOGGER.warning(
234
+ f"User {DEFAULT_USERNAME!r} with default credentials has been found in the database. "
235
+ "If you are using argilla in a production environment this can be a serious security problem. "
236
+ f"We recommend that you create a new admin user and then delete the default {DEFAULT_USERNAME!r} one."
237
+ )
238
+
239
+ @app.on_event("startup")
240
+ async def log_default_user_warning_if_present():
241
+ async with _get_db_wrapper() as db:
242
+ default_user = await accounts.get_user_by_username(db, DEFAULT_USERNAME)
243
+ if default_user and _user_has_default_credentials(default_user):
244
+ _log_default_user_warning()
245
+
246
+
247
+ app = create_server_app()
@@ -0,0 +1,18 @@
1
+ # Copyright 2021-present, the Recognai S.L. team.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ ARGILLA_METADATA_FIELD_WARNING_MESSAGE = (
16
+ "You can configure this length in the server with the ARGILLA_METADATA_FIELD_LENGTH "
17
+ "environment variable. Note that, setting this too high may lead to Elastic performance issues."
18
+ )
@@ -0,0 +1,16 @@
1
+ # Copyright 2021-present, the Recognai S.L. team.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # coding: utf-8
16
+ __version__ = "0.1.0a0"
@@ -0,0 +1,94 @@
1
+ # Copyright 2021-present, the Recognai S.L. team.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from logging.config import fileConfig
16
+
17
+ from alembic import context
18
+ from argilla_server.database import database_url_sync
19
+ from argilla_server.models.base import DatabaseModel
20
+ from argilla_server.models.database import * # noqa: I001
21
+ from sqlalchemy import engine_from_config, pool
22
+
23
+ # this is the Alembic Config object, which provides
24
+ # access to the values within the .ini file in use.
25
+ config = context.config
26
+
27
+ # Overwrites the SQLAlchemy URL getting it from argilla database_url settings
28
+ config.set_main_option("sqlalchemy.url", database_url_sync())
29
+
30
+ # Interpret the config file for Python logging.
31
+ # This line sets up loggers basically.
32
+ if config.config_file_name is not None:
33
+ fileConfig(config.config_file_name)
34
+
35
+ # add your model's MetaData object here
36
+ # for 'autogenerate' support
37
+ # from myapp import mymodel
38
+ # target_metadata = mymodel.Base.metadata
39
+ target_metadata = DatabaseModel.metadata
40
+
41
+ # other values from the config, defined by the needs of env.py,
42
+ # can be acquired:
43
+ # my_important_option = config.get_main_option("my_important_option")
44
+ # ... etc.
45
+
46
+
47
+ def run_migrations_offline() -> None:
48
+ """Run migrations in 'offline' mode.
49
+
50
+ This configures the context with just a URL
51
+ and not an Engine, though an Engine is acceptable
52
+ here as well. By skipping the Engine creation
53
+ we don't even need a DBAPI to be available.
54
+
55
+ Calls to context.execute() here emit the given string to the
56
+ script output.
57
+
58
+ """
59
+ url = config.get_main_option("sqlalchemy.url")
60
+ context.configure(
61
+ url=url,
62
+ target_metadata=target_metadata,
63
+ literal_binds=True,
64
+ dialect_opts={"paramstyle": "named"},
65
+ )
66
+
67
+ with context.begin_transaction():
68
+ context.run_migrations()
69
+
70
+
71
+ def run_migrations_online() -> None:
72
+ """Run migrations in 'online' mode.
73
+
74
+ In this scenario we need to create an Engine
75
+ and associate a connection with the context.
76
+
77
+ """
78
+ connectable = engine_from_config(
79
+ config.get_section(config.config_ini_section),
80
+ prefix="sqlalchemy.",
81
+ poolclass=pool.NullPool,
82
+ )
83
+
84
+ with connectable.connect() as connection:
85
+ context.configure(connection=connection, target_metadata=target_metadata)
86
+
87
+ with context.begin_transaction():
88
+ context.run_migrations()
89
+
90
+
91
+ if context.is_offline_mode():
92
+ run_migrations_offline()
93
+ else:
94
+ run_migrations_online()