structifyai 1.138.10__py3-none-any.whl → 1.176.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.
Files changed (418) hide show
  1. structify/__init__.py +3 -1
  2. structify/_base_client.py +152 -23
  3. structify/_client.py +1127 -228
  4. structify/_compat.py +48 -48
  5. structify/_models.py +102 -59
  6. structify/_qs.py +7 -7
  7. structify/_streaming.py +12 -12
  8. structify/_types.py +30 -13
  9. structify/_utils/__init__.py +8 -2
  10. structify/_utils/_compat.py +45 -0
  11. structify/_utils/_datetime_parse.py +136 -0
  12. structify/_utils/_sync.py +3 -31
  13. structify/_utils/_transform.py +13 -3
  14. structify/_utils/_typing.py +1 -1
  15. structify/_utils/_utils.py +5 -6
  16. structify/_version.py +1 -1
  17. structify/lib/__init__.py +5 -0
  18. structify/lib/cost_confirmation.py +63 -0
  19. structify/pagination.py +63 -1
  20. structify/resources/__init__.py +114 -28
  21. structify/resources/admin/__init__.py +53 -39
  22. structify/resources/admin/admin.py +90 -58
  23. structify/resources/admin/chat_templates.py +382 -0
  24. structify/resources/admin/dataset.py +3 -3
  25. structify/resources/admin/functional_tests.py +600 -0
  26. structify/resources/admin/jobs.py +86 -13
  27. structify/resources/admin/sandbox.py +184 -0
  28. structify/resources/admin/{next_action.py → teams.py} +303 -295
  29. structify/resources/admin/users.py +71 -166
  30. structify/resources/chat.py +1197 -226
  31. structify/resources/code.py +115 -29
  32. structify/resources/connector_catalog/__init__.py +33 -0
  33. structify/resources/connector_catalog/admin.py +1510 -0
  34. structify/resources/connector_catalog/connector_catalog.py +394 -0
  35. structify/resources/connectors/__init__.py +33 -0
  36. structify/resources/connectors/connectors.py +2227 -0
  37. structify/resources/connectors/type_snippets.py +169 -0
  38. structify/resources/datasets/datasets.py +168 -88
  39. structify/resources/datasets/evaluate.py +13 -13
  40. structify/resources/documents.py +46 -140
  41. structify/resources/entities.py +298 -75
  42. structify/resources/external.py +99 -0
  43. structify/resources/external_dataframe_proxy.py +290 -0
  44. structify/resources/jobs.py +79 -380
  45. structify/resources/match.py +337 -0
  46. structify/resources/nango.py +234 -0
  47. structify/resources/polars.py +382 -180
  48. structify/resources/projects.py +123 -10
  49. structify/resources/public_sessions.py +5 -5
  50. structify/resources/sandbox.py +19 -85
  51. structify/resources/scrape.py +17 -33
  52. structify/resources/server.py +3 -3
  53. structify/resources/sessions.py +711 -164
  54. structify/resources/slack.py +330 -0
  55. structify/resources/sources.py +9 -9
  56. structify/resources/structure.py +172 -100
  57. structify/resources/teams.py +450 -42
  58. structify/resources/user/__init__.py +14 -0
  59. structify/resources/user/api_keys.py +380 -0
  60. structify/resources/user/stripe.py +97 -6
  61. structify/resources/user/user.py +228 -60
  62. structify/resources/whitelabel.py +329 -0
  63. structify/resources/whitelabel_service.py +222 -0
  64. structify/resources/{secrets.py → wiki.py} +166 -172
  65. structify/resources/workflow.py +250 -0
  66. structify/resources/workflow_schedule.py +194 -34
  67. structify/types/__init__.py +147 -35
  68. structify/types/accept_invitation_response.py +13 -0
  69. structify/types/add_member_response.py +37 -3
  70. structify/types/admin/__init__.py +34 -85
  71. structify/types/admin/admin_dataset_return.py +6 -0
  72. structify/types/admin/{user_get_credits_response.py → admin_delete_jobs_response.py} +3 -3
  73. structify/types/admin/admin_list_jobs_response.py +35 -1
  74. structify/types/admin/admin_sandbox.py +38 -0
  75. structify/types/admin/admin_teams_list_response.py +53 -0
  76. structify/types/admin/cancel_subscription_response.py +11 -0
  77. structify/types/admin/chat_template_create_params.py +21 -0
  78. structify/types/admin/chat_template_list_params.py +12 -0
  79. structify/types/{secret_list_response.py → admin/chat_template_list_response.py} +3 -3
  80. structify/types/admin/chat_template_update_params.py +22 -0
  81. structify/types/admin/create_subscription_response.py +13 -0
  82. structify/types/admin/{delete_action_training_data_response.py → expire_grants_response.py} +5 -3
  83. structify/types/admin/extend_trial_response.py +15 -0
  84. structify/types/admin/functional_test.py +22 -0
  85. structify/types/{report_step_params.py → admin/functional_test_create_params.py} +6 -5
  86. structify/types/admin/functional_test_get_results_params.py +14 -0
  87. structify/types/admin/functional_test_link_chat_params.py +18 -0
  88. structify/types/admin/functional_test_list_response.py +28 -0
  89. structify/types/admin/functional_test_results_response.py +23 -0
  90. structify/types/{report_missing_response.py → admin/functional_test_system_prompt_response.py} +2 -2
  91. structify/types/admin/functional_test_update_results_params.py +18 -0
  92. structify/types/admin/grant_credits_response.py +13 -0
  93. structify/types/admin/impersonate_response.py +17 -0
  94. structify/types/admin/job_delete_params.py +13 -0
  95. structify/types/admin/{user_get_credits_params.py → sandbox_list_params.py} +4 -4
  96. structify/types/admin/sandbox_type.py +7 -0
  97. structify/types/admin/{training_dataset_delete_params.py → team_cancel_subscription_params.py} +3 -3
  98. structify/types/admin/team_create_subscription_params.py +25 -0
  99. structify/types/admin/{user_set_credits_params.py → team_expire_grants_params.py} +4 -4
  100. structify/types/admin/{training_dataset_list_datums_params.py → team_extend_trial_params.py} +4 -4
  101. structify/types/admin/team_grant_credits_params.py +25 -0
  102. structify/types/admin/team_list_params.py +14 -0
  103. structify/types/admin/user.py +42 -2
  104. structify/types/admin/user_create_params.py +7 -0
  105. structify/types/admin/{training_dataset_get_datum_info_params.py → user_impersonate_params.py} +3 -3
  106. structify/types/admin/user_list_response.py +14 -4
  107. structify/types/admin_grant_access_response.py +16 -0
  108. structify/types/{toggle_public_response.py → admin_issue_found_response.py} +3 -3
  109. structify/types/autofix_context.py +7 -0
  110. structify/types/chat_add_collaborator_params.py +2 -2
  111. structify/types/chat_add_git_commit_response.py +2 -0
  112. structify/types/chat_admin_issue_found_params.py +13 -0
  113. structify/types/chat_copy_node_output_by_code_hash_params.py +1 -2
  114. structify/types/chat_copy_params.py +20 -0
  115. structify/types/chat_create_session_params.py +48 -5
  116. structify/types/{admin/training_dataset_add_datum_params.py → chat_delete_files_params.py} +4 -4
  117. structify/types/{get_project_response.py → chat_delete_files_response.py} +3 -4
  118. structify/types/chat_dependency.py +17 -0
  119. structify/types/chat_event.py +166 -0
  120. structify/types/chat_get_git_commit_response.py +2 -0
  121. structify/types/{admin/human_llm_get_jobs_response.py → chat_get_partial_chats_response.py} +3 -3
  122. structify/types/chat_get_session_timeline_response.py +36 -2
  123. structify/types/chat_grant_admin_override_params.py +16 -0
  124. structify/types/chat_list_sessions_params.py +7 -1
  125. structify/types/chat_list_templates_response.py +10 -0
  126. structify/types/{admin/training_dataset_download_datum_params.py → chat_load_files_params.py} +5 -4
  127. structify/types/chat_load_files_response.py +13 -0
  128. structify/types/chat_prompt.py +9 -28
  129. structify/types/chat_revert_to_commit_params.py +12 -0
  130. structify/types/chat_revert_to_commit_response.py +17 -0
  131. structify/types/chat_session.py +31 -2
  132. structify/types/chat_session_role.py +1 -1
  133. structify/types/chat_session_with_messages.py +43 -5
  134. structify/types/chat_template.py +31 -0
  135. structify/types/{admin/training_dataset_remove_datum_params.py → chat_update_session_favorite_params.py} +3 -3
  136. structify/types/chat_update_session_params.py +4 -2
  137. structify/types/chat_update_visibility_params.py +13 -0
  138. structify/types/chat_visibility.py +7 -0
  139. structify/types/code_generate_code_params.py +48 -10
  140. structify/types/code_interrupt_generation_params.py +13 -0
  141. structify/types/connector.py +50 -0
  142. structify/types/connector_auth_method.py +29 -0
  143. structify/types/connector_auth_method_with_fields.py +15 -0
  144. structify/types/connector_catalog/__init__.py +32 -0
  145. structify/types/connector_catalog/admin_batch_create_credential_fields_params.py +14 -0
  146. structify/types/connector_catalog/admin_batch_create_credential_fields_response.py +10 -0
  147. structify/types/connector_catalog/admin_batch_create_scopes_params.py +14 -0
  148. structify/types/connector_catalog/admin_create_auth_method_params.py +22 -0
  149. structify/types/connector_catalog/admin_create_catalog_params.py +22 -0
  150. structify/types/connector_catalog/admin_create_credential_field_params.py +28 -0
  151. structify/types/connector_catalog/admin_create_scope_params.py +19 -0
  152. structify/types/connector_catalog/admin_list_nango_pending_response.py +10 -0
  153. structify/types/{chat_add_message_params.py → connector_catalog/admin_list_scopes_params.py} +3 -5
  154. structify/types/connector_catalog/admin_update_auth_method_params.py +16 -0
  155. structify/types/connector_catalog/admin_update_catalog_params.py +20 -0
  156. structify/types/connector_catalog/admin_update_credential_field_params.py +26 -0
  157. structify/types/connector_catalog/admin_update_scope_params.py +18 -0
  158. structify/types/{admin/human_llm_get_next_step_params.py → connector_catalog/admin_upload_logo_params.py} +4 -4
  159. structify/types/connector_catalog/batch_create_scopes_response.py +12 -0
  160. structify/types/connector_catalog/connector_auth_method_scope.py +25 -0
  161. structify/types/connector_catalog/connector_catalog.py +26 -0
  162. structify/types/connector_catalog/create_credential_field_request_param.py +28 -0
  163. structify/types/connector_catalog/create_scope_request_param.py +19 -0
  164. structify/types/connector_catalog/list_scopes_response.py +12 -0
  165. structify/types/connector_catalog/pending_nango_integration.py +17 -0
  166. structify/types/{admin/user_set_credits_response.py → connector_catalog/upload_logo_response.py} +3 -3
  167. structify/types/connector_catalog_list_params.py +20 -0
  168. structify/types/connector_catalog_list_response.py +22 -0
  169. structify/types/connector_catalog_with_methods.py +15 -0
  170. structify/types/connector_category.py +7 -0
  171. structify/types/connector_create_params.py +36 -0
  172. structify/types/{secret_create_params.py → connector_create_secret_params.py} +2 -2
  173. structify/types/connector_credential_field.py +34 -0
  174. structify/types/connector_delete_schema_object_params.py +35 -0
  175. structify/types/connector_explore_params.py +19 -0
  176. structify/types/connector_explorer_chat.py +34 -0
  177. structify/types/connector_get_clarification_requests_response.py +36 -0
  178. structify/types/connector_get_explorer_chat_params.py +12 -0
  179. structify/types/connector_get_response.py +25 -0
  180. structify/types/connector_list_params.py +16 -0
  181. structify/types/connector_list_with_snippets_params.py +12 -0
  182. structify/types/connector_list_with_snippets_response.py +10 -0
  183. structify/types/connector_search_tables_params.py +15 -0
  184. structify/types/connector_search_tables_response.py +160 -0
  185. structify/types/connector_store_response.py +21 -0
  186. structify/types/connector_summaries_params.py +15 -0
  187. structify/types/connector_summaries_response.py +10 -0
  188. structify/types/connector_summary.py +16 -0
  189. structify/types/connector_table_info.py +15 -0
  190. structify/types/connector_update_column_params.py +12 -0
  191. structify/types/connector_update_params.py +20 -0
  192. structify/types/connector_update_table_params.py +14 -0
  193. structify/types/connector_with_secrets.py +25 -0
  194. structify/types/connector_with_snippets.py +11 -0
  195. structify/types/connectors/__init__.py +6 -0
  196. structify/types/connectors/snippet.py +20 -0
  197. structify/types/connectors/type_snippet_upsert_params.py +12 -0
  198. structify/types/create_chat_session_response.py +2 -0
  199. structify/types/create_match_jobs_response.py +15 -0
  200. structify/types/dashboard_component.py +17 -0
  201. structify/types/{report_relationship_params.py → dashboard_component_param.py} +6 -6
  202. structify/types/dashboard_layout.py +16 -0
  203. structify/types/dashboard_layout_param.py +18 -0
  204. structify/types/dataset_count_missing_embeddings_params.py +11 -0
  205. structify/types/dataset_count_missing_embeddings_response.py +9 -0
  206. structify/types/dataset_create_params.py +0 -2
  207. structify/types/dataset_descriptor.py +6 -0
  208. structify/types/dataset_descriptor_param.py +6 -0
  209. structify/types/dataset_get_response.py +6 -0
  210. structify/types/dataset_list_response.py +6 -0
  211. structify/types/dataset_reorder_properties_params.py +3 -2
  212. structify/types/dataset_view_table_response.py +3 -1
  213. structify/types/delete_chat_session_response.py +2 -0
  214. structify/types/delete_schema_object_request_param.py +35 -0
  215. structify/types/delete_schema_object_response.py +13 -0
  216. structify/types/document_list_params.py +2 -0
  217. structify/types/document_list_response.py +2 -0
  218. structify/types/document_upload_params.py +2 -0
  219. structify/types/edge_spec_param.py +13 -0
  220. structify/types/entity_agent_merge_params.py +3 -2
  221. structify/types/entity_derive_all_params.py +20 -0
  222. structify/types/{admin/training_dataset_list_response.py → entity_derive_all_response.py} +2 -2
  223. structify/types/entity_get_source_entities_response.py +0 -2
  224. structify/types/entity_list_jobs_response.py +3 -3
  225. structify/types/entity_summarize_params.py +5 -3
  226. structify/types/entity_upload_parquet_params.py +17 -0
  227. structify/types/entity_view_response.py +0 -2
  228. structify/types/estimate_cost_response.py +9 -0
  229. structify/types/exploration_phase_id.py +79 -0
  230. structify/types/{project_secret_summary.py → exploration_run.py} +3 -7
  231. structify/types/exploration_runs_response.py +12 -0
  232. structify/types/exploration_status.py +7 -0
  233. structify/types/explore_status_response.py +17 -0
  234. structify/types/explorer_chat_response.py +12 -0
  235. structify/types/finalize_dag_response.py +11 -0
  236. structify/types/get_chat_session_response.py +77 -3
  237. structify/types/get_dependencies_response.py +15 -0
  238. structify/types/get_job_events_response.py +20 -0
  239. structify/types/get_node_logs_response.py +12 -0
  240. structify/types/get_node_response.py +10 -0
  241. structify/types/get_team_response.py +3 -0
  242. structify/types/invitation_details_response.py +13 -0
  243. structify/types/job_cancel_response.py +3 -3
  244. structify/types/job_event_body.py +206 -0
  245. structify/types/job_get_source_entities_response.py +0 -2
  246. structify/types/job_list_params.py +4 -1
  247. structify/types/job_list_response.py +35 -1
  248. structify/types/job_status_params.py +6 -2
  249. structify/types/knowledge_graph.py +8 -2
  250. structify/types/knowledge_graph_param.py +7 -1
  251. structify/types/list_chat_sessions_response.py +10 -1
  252. structify/types/list_collaborators_response.py +4 -0
  253. structify/types/list_members_response.py +16 -3
  254. structify/types/list_tables_response.py +12 -0
  255. structify/types/llm_information_store.py +87 -0
  256. structify/types/match_create_jobs_params.py +24 -0
  257. structify/types/match_list_results_params.py +21 -0
  258. structify/types/match_result.py +28 -0
  259. structify/types/merge_config.py +2 -0
  260. structify/types/merge_config_param.py +2 -0
  261. structify/types/message.py +36 -0
  262. structify/types/nango_create_session_params.py +21 -0
  263. structify/types/nango_create_session_response.py +15 -0
  264. structify/types/nango_list_integrations_response.py +28 -0
  265. structify/types/{session_create_node_params.py → node_spec_param.py} +6 -3
  266. structify/types/project.py +3 -0
  267. structify/types/project_collaborator_input_param.py +15 -0
  268. structify/types/project_get_response.py +12 -0
  269. structify/types/{get_secret_response.py → project_member.py} +7 -4
  270. structify/types/project_update_params.py +23 -0
  271. structify/types/project_visibility.py +7 -0
  272. structify/types/property_type_param.py +3 -2
  273. structify/types/refresh_session_response.py +15 -0
  274. structify/types/sandbox.py +8 -2
  275. structify/types/sandbox_get_params.py +2 -1
  276. structify/types/save_requirement_param.py +4 -2
  277. structify/types/scrape_list_params.py +1 -22
  278. structify/types/scrape_list_response.py +2 -0
  279. structify/types/scrape_scrape_params.py +1 -14
  280. structify/types/scrape_scrape_response.py +2 -0
  281. structify/types/select_team_response.py +13 -0
  282. structify/types/session_confirm_node_params.py +11 -0
  283. structify/types/session_finalize_dag_params.py +20 -0
  284. structify/types/session_get_events_params.py +8 -3
  285. structify/types/session_get_events_response.py +43 -0
  286. structify/types/session_get_node_progress_response.py +17 -3
  287. structify/types/{admin/human_llm_start_next_job_params.py → session_kill_jobs_params.py} +3 -3
  288. structify/types/session_kill_jobs_response.py +13 -0
  289. structify/types/session_mark_errored_params.py +6 -0
  290. structify/types/session_request_confirmation_params.py +13 -0
  291. structify/types/session_update_node_progress_params.py +8 -2
  292. structify/types/session_upload_dashboard_layout_params.py +13 -0
  293. structify/types/session_upload_node_output_data_params.py +3 -0
  294. structify/types/session_upload_node_visualization_output_params.py +12 -0
  295. structify/types/slack_api_response.py +21 -0
  296. structify/types/slack_event_payload_param.py +77 -0
  297. structify/types/slack_events_params.py +77 -0
  298. structify/types/source_list_response.py +0 -2
  299. structify/types/structure_enhance_property_params.py +8 -21
  300. structify/types/structure_enhance_relationship_params.py +8 -21
  301. structify/types/structure_find_relationship_params.py +7 -21
  302. structify/types/structure_is_complete_params.py +3 -2
  303. structify/types/structure_job_status_params.py +4 -2
  304. structify/types/structure_pdf_params.py +22 -0
  305. structify/types/structure_pdf_response.py +11 -0
  306. structify/types/structure_run_async_params.py +15 -21
  307. structify/types/table.py +2 -0
  308. structify/types/table_param.py +2 -0
  309. structify/types/team.py +16 -2
  310. structify/types/team_accept_invitation_params.py +11 -0
  311. structify/types/team_add_member_params.py +2 -2
  312. structify/types/team_create_link_code_params.py +11 -0
  313. structify/types/team_role.py +1 -1
  314. structify/types/team_subscription_status.py +24 -0
  315. structify/types/team_update_member_role_params.py +15 -0
  316. structify/types/team_update_params.py +10 -0
  317. structify/types/team_wiki_page.py +28 -0
  318. structify/types/team_with_role.py +3 -0
  319. structify/types/{update_secret_response.py → teams_link_code_response.py} +4 -4
  320. structify/types/token_response.py +6 -2
  321. structify/types/tool_invocation.py +468 -0
  322. structify/types/tool_result.py +99 -0
  323. structify/types/update_member_role_response.py +9 -0
  324. structify/types/update_table_response.py +46 -0
  325. structify/types/update_visibility_response.py +10 -0
  326. structify/types/usage_group_key.py +14 -1
  327. structify/types/user/__init__.py +5 -0
  328. structify/types/{admin/training_dataset_size_params.py → user/api_key_create_params.py} +5 -5
  329. structify/types/user/api_key_info.py +24 -0
  330. structify/types/user/create_api_key_response.py +12 -0
  331. structify/types/user/list_api_keys_response.py +12 -0
  332. structify/types/{admin/human_llm_add_search_for_job_params.py → user/stripe_create_portal_session_params.py} +4 -4
  333. structify/types/user/subscription_plan.py +1 -1
  334. structify/types/{chat_toggle_public_params.py → user_enrich_params.py} +3 -3
  335. structify/types/user_info.py +31 -1
  336. structify/types/user_refresh_params.py +13 -0
  337. structify/types/user_transactions_response.py +5 -1
  338. structify/types/user_update_params.py +61 -13
  339. structify/types/user_usage_response.py +0 -2
  340. structify/types/wiki_connector_reference.py +63 -0
  341. structify/types/wiki_create_params.py +16 -0
  342. structify/types/{job_get_steps_response.py → wiki_list_response.py} +3 -3
  343. structify/types/wiki_page_with_references.py +12 -0
  344. structify/types/wiki_update_params.py +16 -0
  345. structify/types/workflow_dag.py +10 -0
  346. structify/types/workflow_node_execution_status.py +3 -1
  347. structify/types/{user_team.py → workflow_node_log.py} +6 -7
  348. structify/types/workflow_run_params.py +13 -0
  349. structify/types/workflow_schedule_create_params.py +2 -2
  350. structify/types/workflow_schedule_info.py +4 -2
  351. structify/types/workflow_schedule_pause_params.py +11 -0
  352. structify/types/workflow_schedule_update_params.py +2 -0
  353. structify/types/workflow_session.py +8 -0
  354. structify/types/workflow_session_node.py +16 -0
  355. structify/types/workflow_stop_params.py +11 -0
  356. {structifyai-1.138.10.dist-info → structifyai-1.176.1.dist-info}/METADATA +73 -194
  357. structifyai-1.176.1.dist-info/RECORD +496 -0
  358. {structifyai-1.138.10.dist-info → structifyai-1.176.1.dist-info}/licenses/LICENSE +1 -1
  359. structify/resources/admin/human_llm.py +0 -819
  360. structify/resources/admin/training_datasets.py +0 -2028
  361. structify/resources/report.py +0 -494
  362. structify/types/add_chat_message_response.py +0 -25
  363. structify/types/admin/action_training_data_entry.py +0 -219
  364. structify/types/admin/action_training_data_response.py +0 -12
  365. structify/types/admin/datum_status.py +0 -19
  366. structify/types/admin/human_llm_add_to_dataset_params.py +0 -186
  367. structify/types/admin/human_llm_finish_job_params.py +0 -13
  368. structify/types/admin/human_llm_get_jobs_params.py +0 -12
  369. structify/types/admin/human_llm_get_next_step_response.py +0 -196
  370. structify/types/admin/human_llm_job.py +0 -73
  371. structify/types/admin/human_llm_prelabel_step_response.py +0 -184
  372. structify/types/admin/human_llm_update_step_params.py +0 -186
  373. structify/types/admin/labeling_stats.py +0 -24
  374. structify/types/admin/next_action_add_training_datum_params.py +0 -203
  375. structify/types/admin/next_action_delete_training_data_params.py +0 -12
  376. structify/types/admin/next_action_get_batched_training_data_params.py +0 -12
  377. structify/types/admin/next_action_get_training_data_params.py +0 -25
  378. structify/types/admin/next_action_get_training_datum_params.py +0 -12
  379. structify/types/admin/next_action_label_training_datum_params.py +0 -90
  380. structify/types/admin/step_choices.py +0 -32
  381. structify/types/admin/training_dataset_add_params.py +0 -12
  382. structify/types/admin/training_dataset_get_labeller_stats_params.py +0 -23
  383. structify/types/admin/training_dataset_get_labeller_stats_response.py +0 -10
  384. structify/types/admin/training_dataset_get_next_for_labeling_params.py +0 -15
  385. structify/types/admin/training_dataset_get_next_for_qa_params.py +0 -18
  386. structify/types/admin/training_dataset_get_next_suspicious_params.py +0 -23
  387. structify/types/admin/training_dataset_label_datum_params.py +0 -188
  388. structify/types/admin/training_dataset_list_datums_response.py +0 -33
  389. structify/types/admin/training_dataset_mark_datum_suspicious_params.py +0 -19
  390. structify/types/admin/training_dataset_size_response.py +0 -37
  391. structify/types/admin/training_dataset_suspicious_count_params.py +0 -23
  392. structify/types/admin/training_dataset_suspicious_count_response.py +0 -9
  393. structify/types/admin/training_dataset_switch_dataset_params.py +0 -13
  394. structify/types/admin/training_dataset_update_datum_status_params.py +0 -18
  395. structify/types/admin/training_dataset_upload_labeled_step_params.py +0 -15
  396. structify/types/admin/training_dataset_verify_datum_params.py +0 -17
  397. structify/types/admin/training_datum_response.py +0 -405
  398. structify/types/chat_prompt_param.py +0 -274
  399. structify/types/create_project_response.py +0 -10
  400. structify/types/document_structure_params.py +0 -21
  401. structify/types/document_structure_response.py +0 -8
  402. structify/types/execution_step.py +0 -198
  403. structify/types/get_session_events_response.py +0 -26
  404. structify/types/job_delete_response.py +0 -7
  405. structify/types/job_get_response.py +0 -62
  406. structify/types/job_get_step_graph_response.py +0 -233
  407. structify/types/job_get_step_response.py +0 -196
  408. structify/types/report_missing_params.py +0 -18
  409. structify/types/report_relationship_response.py +0 -7
  410. structify/types/report_step_response.py +0 -7
  411. structify/types/report_wrong_params.py +0 -18
  412. structify/types/report_wrong_response.py +0 -7
  413. structify/types/secret_update_params.py +0 -14
  414. structify/types/session_create_edge_params.py +0 -13
  415. structify/types/tool_metadata_param.py +0 -17
  416. structify/types/workflow_schedule_get_response.py +0 -10
  417. structifyai-1.138.10.dist-info/RECORD +0 -370
  418. {structifyai-1.138.10.dist-info → structifyai-1.176.1.dist-info}/WHEEL +0 -0
structify/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  import typing as _t
4
4
 
5
5
  from . import types
6
- from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
6
+ from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
7
7
  from ._utils import file_from_path
8
8
  from ._client import (
9
9
  ENVIRONMENTS,
@@ -49,7 +49,9 @@ __all__ = [
49
49
  "ProxiesTypes",
50
50
  "NotGiven",
51
51
  "NOT_GIVEN",
52
+ "not_given",
52
53
  "Omit",
54
+ "omit",
53
55
  "StructifyError",
54
56
  "APIError",
55
57
  "APIStatusError",
structify/_base_client.py CHANGED
@@ -9,6 +9,7 @@ import asyncio
9
9
  import inspect
10
10
  import logging
11
11
  import platform
12
+ import warnings
12
13
  import email.utils
13
14
  from types import TracebackType
14
15
  from random import random
@@ -42,7 +43,6 @@ from . import _exceptions
42
43
  from ._qs import Querystring
43
44
  from ._files import to_httpx_files, async_to_httpx_files
44
45
  from ._types import (
45
- NOT_GIVEN,
46
46
  Body,
47
47
  Omit,
48
48
  Query,
@@ -52,14 +52,17 @@ from ._types import (
52
52
  ResponseT,
53
53
  AnyMapping,
54
54
  PostParser,
55
+ BinaryTypes,
55
56
  RequestFiles,
56
57
  HttpxSendArgs,
57
58
  RequestOptions,
59
+ AsyncBinaryTypes,
58
60
  HttpxRequestFiles,
59
61
  ModelBuilderProtocol,
62
+ not_given,
60
63
  )
61
64
  from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
62
- from ._compat import PYDANTIC_V2, model_copy, model_dump
65
+ from ._compat import PYDANTIC_V1, model_copy, model_dump
63
66
  from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
64
67
  from ._response import (
65
68
  APIResponse,
@@ -145,9 +148,9 @@ class PageInfo:
145
148
  def __init__(
146
149
  self,
147
150
  *,
148
- url: URL | NotGiven = NOT_GIVEN,
149
- json: Body | NotGiven = NOT_GIVEN,
150
- params: Query | NotGiven = NOT_GIVEN,
151
+ url: URL | NotGiven = not_given,
152
+ json: Body | NotGiven = not_given,
153
+ params: Query | NotGiven = not_given,
151
154
  ) -> None:
152
155
  self.url = url
153
156
  self.json = json
@@ -232,7 +235,7 @@ class BaseSyncPage(BasePage[_T], Generic[_T]):
232
235
  model: Type[_T],
233
236
  options: FinalRequestOptions,
234
237
  ) -> None:
235
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
238
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
236
239
  self.__pydantic_private__ = {}
237
240
 
238
241
  self._model = model
@@ -320,7 +323,7 @@ class BaseAsyncPage(BasePage[_T], Generic[_T]):
320
323
  client: AsyncAPIClient,
321
324
  options: FinalRequestOptions,
322
325
  ) -> None:
323
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
326
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
324
327
  self.__pydantic_private__ = {}
325
328
 
326
329
  self._model = model
@@ -477,8 +480,19 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
477
480
  retries_taken: int = 0,
478
481
  ) -> httpx.Request:
479
482
  if log.isEnabledFor(logging.DEBUG):
480
- log.debug("Request options: %s", model_dump(options, exclude_unset=True))
481
-
483
+ log.debug(
484
+ "Request options: %s",
485
+ model_dump(
486
+ options,
487
+ exclude_unset=True,
488
+ # Pydantic v1 can't dump every type we support in content, so we exclude it for now.
489
+ exclude={
490
+ "content",
491
+ }
492
+ if PYDANTIC_V1
493
+ else {},
494
+ ),
495
+ )
482
496
  kwargs: dict[str, Any] = {}
483
497
 
484
498
  json_data = options.json_data
@@ -532,7 +546,13 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
532
546
  is_body_allowed = options.method.lower() != "get"
533
547
 
534
548
  if is_body_allowed:
535
- if isinstance(json_data, bytes):
549
+ if options.content is not None and json_data is not None:
550
+ raise TypeError("Passing both `content` and `json_data` is not supported")
551
+ if options.content is not None and files is not None:
552
+ raise TypeError("Passing both `content` and `files` is not supported")
553
+ if options.content is not None:
554
+ kwargs["content"] = options.content
555
+ elif isinstance(json_data, bytes):
536
556
  kwargs["content"] = json_data
537
557
  else:
538
558
  kwargs["json"] = json_data if is_given(json_data) else None
@@ -595,7 +615,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
595
615
  # we internally support defining a temporary header to override the
596
616
  # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
597
617
  # see _response.py for implementation details
598
- override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
618
+ override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
599
619
  if is_given(override_cast_to):
600
620
  options.headers = headers
601
621
  return cast(Type[ResponseT], override_cast_to)
@@ -825,7 +845,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
825
845
  version: str,
826
846
  base_url: str | URL,
827
847
  max_retries: int = DEFAULT_MAX_RETRIES,
828
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
848
+ timeout: float | Timeout | None | NotGiven = not_given,
829
849
  http_client: httpx.Client | None = None,
830
850
  custom_headers: Mapping[str, str] | None = None,
831
851
  custom_query: Mapping[str, object] | None = None,
@@ -1194,6 +1214,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1194
1214
  *,
1195
1215
  cast_to: Type[ResponseT],
1196
1216
  body: Body | None = None,
1217
+ content: BinaryTypes | None = None,
1197
1218
  options: RequestOptions = {},
1198
1219
  files: RequestFiles | None = None,
1199
1220
  stream: Literal[False] = False,
@@ -1206,6 +1227,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1206
1227
  *,
1207
1228
  cast_to: Type[ResponseT],
1208
1229
  body: Body | None = None,
1230
+ content: BinaryTypes | None = None,
1209
1231
  options: RequestOptions = {},
1210
1232
  files: RequestFiles | None = None,
1211
1233
  stream: Literal[True],
@@ -1219,6 +1241,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1219
1241
  *,
1220
1242
  cast_to: Type[ResponseT],
1221
1243
  body: Body | None = None,
1244
+ content: BinaryTypes | None = None,
1222
1245
  options: RequestOptions = {},
1223
1246
  files: RequestFiles | None = None,
1224
1247
  stream: bool,
@@ -1231,13 +1254,25 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1231
1254
  *,
1232
1255
  cast_to: Type[ResponseT],
1233
1256
  body: Body | None = None,
1257
+ content: BinaryTypes | None = None,
1234
1258
  options: RequestOptions = {},
1235
1259
  files: RequestFiles | None = None,
1236
1260
  stream: bool = False,
1237
1261
  stream_cls: type[_StreamT] | None = None,
1238
1262
  ) -> ResponseT | _StreamT:
1263
+ if body is not None and content is not None:
1264
+ raise TypeError("Passing both `body` and `content` is not supported")
1265
+ if files is not None and content is not None:
1266
+ raise TypeError("Passing both `files` and `content` is not supported")
1267
+ if isinstance(body, bytes):
1268
+ warnings.warn(
1269
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1270
+ "Please pass raw bytes via the `content` parameter instead.",
1271
+ DeprecationWarning,
1272
+ stacklevel=2,
1273
+ )
1239
1274
  opts = FinalRequestOptions.construct(
1240
- method="post", url=path, json_data=body, files=to_httpx_files(files), **options
1275
+ method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1241
1276
  )
1242
1277
  return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
1243
1278
 
@@ -1247,9 +1282,24 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1247
1282
  *,
1248
1283
  cast_to: Type[ResponseT],
1249
1284
  body: Body | None = None,
1285
+ content: BinaryTypes | None = None,
1286
+ files: RequestFiles | None = None,
1250
1287
  options: RequestOptions = {},
1251
1288
  ) -> ResponseT:
1252
- opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
1289
+ if body is not None and content is not None:
1290
+ raise TypeError("Passing both `body` and `content` is not supported")
1291
+ if files is not None and content is not None:
1292
+ raise TypeError("Passing both `files` and `content` is not supported")
1293
+ if isinstance(body, bytes):
1294
+ warnings.warn(
1295
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1296
+ "Please pass raw bytes via the `content` parameter instead.",
1297
+ DeprecationWarning,
1298
+ stacklevel=2,
1299
+ )
1300
+ opts = FinalRequestOptions.construct(
1301
+ method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1302
+ )
1253
1303
  return self.request(cast_to, opts)
1254
1304
 
1255
1305
  def put(
@@ -1258,11 +1308,23 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1258
1308
  *,
1259
1309
  cast_to: Type[ResponseT],
1260
1310
  body: Body | None = None,
1311
+ content: BinaryTypes | None = None,
1261
1312
  files: RequestFiles | None = None,
1262
1313
  options: RequestOptions = {},
1263
1314
  ) -> ResponseT:
1315
+ if body is not None and content is not None:
1316
+ raise TypeError("Passing both `body` and `content` is not supported")
1317
+ if files is not None and content is not None:
1318
+ raise TypeError("Passing both `files` and `content` is not supported")
1319
+ if isinstance(body, bytes):
1320
+ warnings.warn(
1321
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1322
+ "Please pass raw bytes via the `content` parameter instead.",
1323
+ DeprecationWarning,
1324
+ stacklevel=2,
1325
+ )
1264
1326
  opts = FinalRequestOptions.construct(
1265
- method="put", url=path, json_data=body, files=to_httpx_files(files), **options
1327
+ method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1266
1328
  )
1267
1329
  return self.request(cast_to, opts)
1268
1330
 
@@ -1272,9 +1334,19 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1272
1334
  *,
1273
1335
  cast_to: Type[ResponseT],
1274
1336
  body: Body | None = None,
1337
+ content: BinaryTypes | None = None,
1275
1338
  options: RequestOptions = {},
1276
1339
  ) -> ResponseT:
1277
- opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
1340
+ if body is not None and content is not None:
1341
+ raise TypeError("Passing both `body` and `content` is not supported")
1342
+ if isinstance(body, bytes):
1343
+ warnings.warn(
1344
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1345
+ "Please pass raw bytes via the `content` parameter instead.",
1346
+ DeprecationWarning,
1347
+ stacklevel=2,
1348
+ )
1349
+ opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
1278
1350
  return self.request(cast_to, opts)
1279
1351
 
1280
1352
  def get_api_list(
@@ -1356,7 +1428,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1356
1428
  base_url: str | URL,
1357
1429
  _strict_response_validation: bool,
1358
1430
  max_retries: int = DEFAULT_MAX_RETRIES,
1359
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
1431
+ timeout: float | Timeout | None | NotGiven = not_given,
1360
1432
  http_client: httpx.AsyncClient | None = None,
1361
1433
  custom_headers: Mapping[str, str] | None = None,
1362
1434
  custom_query: Mapping[str, object] | None = None,
@@ -1714,6 +1786,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1714
1786
  *,
1715
1787
  cast_to: Type[ResponseT],
1716
1788
  body: Body | None = None,
1789
+ content: AsyncBinaryTypes | None = None,
1717
1790
  files: RequestFiles | None = None,
1718
1791
  options: RequestOptions = {},
1719
1792
  stream: Literal[False] = False,
@@ -1726,6 +1799,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1726
1799
  *,
1727
1800
  cast_to: Type[ResponseT],
1728
1801
  body: Body | None = None,
1802
+ content: AsyncBinaryTypes | None = None,
1729
1803
  files: RequestFiles | None = None,
1730
1804
  options: RequestOptions = {},
1731
1805
  stream: Literal[True],
@@ -1739,6 +1813,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1739
1813
  *,
1740
1814
  cast_to: Type[ResponseT],
1741
1815
  body: Body | None = None,
1816
+ content: AsyncBinaryTypes | None = None,
1742
1817
  files: RequestFiles | None = None,
1743
1818
  options: RequestOptions = {},
1744
1819
  stream: bool,
@@ -1751,13 +1826,25 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1751
1826
  *,
1752
1827
  cast_to: Type[ResponseT],
1753
1828
  body: Body | None = None,
1829
+ content: AsyncBinaryTypes | None = None,
1754
1830
  files: RequestFiles | None = None,
1755
1831
  options: RequestOptions = {},
1756
1832
  stream: bool = False,
1757
1833
  stream_cls: type[_AsyncStreamT] | None = None,
1758
1834
  ) -> ResponseT | _AsyncStreamT:
1835
+ if body is not None and content is not None:
1836
+ raise TypeError("Passing both `body` and `content` is not supported")
1837
+ if files is not None and content is not None:
1838
+ raise TypeError("Passing both `files` and `content` is not supported")
1839
+ if isinstance(body, bytes):
1840
+ warnings.warn(
1841
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1842
+ "Please pass raw bytes via the `content` parameter instead.",
1843
+ DeprecationWarning,
1844
+ stacklevel=2,
1845
+ )
1759
1846
  opts = FinalRequestOptions.construct(
1760
- method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options
1847
+ method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
1761
1848
  )
1762
1849
  return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
1763
1850
 
@@ -1767,9 +1854,29 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1767
1854
  *,
1768
1855
  cast_to: Type[ResponseT],
1769
1856
  body: Body | None = None,
1857
+ content: AsyncBinaryTypes | None = None,
1858
+ files: RequestFiles | None = None,
1770
1859
  options: RequestOptions = {},
1771
1860
  ) -> ResponseT:
1772
- opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
1861
+ if body is not None and content is not None:
1862
+ raise TypeError("Passing both `body` and `content` is not supported")
1863
+ if files is not None and content is not None:
1864
+ raise TypeError("Passing both `files` and `content` is not supported")
1865
+ if isinstance(body, bytes):
1866
+ warnings.warn(
1867
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1868
+ "Please pass raw bytes via the `content` parameter instead.",
1869
+ DeprecationWarning,
1870
+ stacklevel=2,
1871
+ )
1872
+ opts = FinalRequestOptions.construct(
1873
+ method="patch",
1874
+ url=path,
1875
+ json_data=body,
1876
+ content=content,
1877
+ files=await async_to_httpx_files(files),
1878
+ **options,
1879
+ )
1773
1880
  return await self.request(cast_to, opts)
1774
1881
 
1775
1882
  async def put(
@@ -1778,11 +1885,23 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1778
1885
  *,
1779
1886
  cast_to: Type[ResponseT],
1780
1887
  body: Body | None = None,
1888
+ content: AsyncBinaryTypes | None = None,
1781
1889
  files: RequestFiles | None = None,
1782
1890
  options: RequestOptions = {},
1783
1891
  ) -> ResponseT:
1892
+ if body is not None and content is not None:
1893
+ raise TypeError("Passing both `body` and `content` is not supported")
1894
+ if files is not None and content is not None:
1895
+ raise TypeError("Passing both `files` and `content` is not supported")
1896
+ if isinstance(body, bytes):
1897
+ warnings.warn(
1898
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1899
+ "Please pass raw bytes via the `content` parameter instead.",
1900
+ DeprecationWarning,
1901
+ stacklevel=2,
1902
+ )
1784
1903
  opts = FinalRequestOptions.construct(
1785
- method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options
1904
+ method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
1786
1905
  )
1787
1906
  return await self.request(cast_to, opts)
1788
1907
 
@@ -1792,9 +1911,19 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1792
1911
  *,
1793
1912
  cast_to: Type[ResponseT],
1794
1913
  body: Body | None = None,
1914
+ content: AsyncBinaryTypes | None = None,
1795
1915
  options: RequestOptions = {},
1796
1916
  ) -> ResponseT:
1797
- opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
1917
+ if body is not None and content is not None:
1918
+ raise TypeError("Passing both `body` and `content` is not supported")
1919
+ if isinstance(body, bytes):
1920
+ warnings.warn(
1921
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1922
+ "Please pass raw bytes via the `content` parameter instead.",
1923
+ DeprecationWarning,
1924
+ stacklevel=2,
1925
+ )
1926
+ opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
1798
1927
  return await self.request(cast_to, opts)
1799
1928
 
1800
1929
  def get_api_list(
@@ -1818,8 +1947,8 @@ def make_request_options(
1818
1947
  extra_query: Query | None = None,
1819
1948
  extra_body: Body | None = None,
1820
1949
  idempotency_key: str | None = None,
1821
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1822
- post_parser: PostParser | NotGiven = NOT_GIVEN,
1950
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1951
+ post_parser: PostParser | NotGiven = not_given,
1823
1952
  ) -> RequestOptions:
1824
1953
  """Create a dict of type RequestOptions without keys of NotGiven values."""
1825
1954
  options: RequestOptions = {}