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
@@ -7,17 +7,24 @@ from typing import Optional
7
7
  import httpx
8
8
 
9
9
  from ..types import (
10
+ ChatVisibility,
10
11
  ChatSessionRole,
11
- chat_add_message_params,
12
+ chat_copy_params,
13
+ chat_load_files_params,
14
+ chat_delete_files_params,
12
15
  chat_list_sessions_params,
13
- chat_toggle_public_params,
14
16
  chat_add_git_commit_params,
15
17
  chat_create_session_params,
16
18
  chat_update_session_params,
17
19
  chat_add_collaborator_params,
20
+ chat_revert_to_commit_params,
21
+ chat_admin_issue_found_params,
22
+ chat_update_visibility_params,
23
+ chat_grant_admin_override_params,
24
+ chat_update_session_favorite_params,
18
25
  chat_copy_node_output_by_code_hash_params,
19
26
  )
20
- from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
27
+ from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
21
28
  from .._utils import maybe_transform, async_maybe_transform
22
29
  from .._compat import cached_property
23
30
  from .._resource import SyncAPIResource, AsyncAPIResource
@@ -28,17 +35,27 @@ from .._response import (
28
35
  async_to_streamed_response_wrapper,
29
36
  )
30
37
  from .._base_client import make_request_options
38
+ from ..types.chat_prompt import ChatPrompt
31
39
  from ..types.chat_session import ChatSession
40
+ from ..types.chat_visibility import ChatVisibility
32
41
  from ..types.chat_session_role import ChatSessionRole
33
- from ..types.toggle_public_response import TogglePublicResponse
34
- from ..types.add_chat_message_response import AddChatMessageResponse
42
+ from ..types.chat_load_files_response import ChatLoadFilesResponse
35
43
  from ..types.get_chat_session_response import GetChatSessionResponse
44
+ from ..types.get_dependencies_response import GetDependenciesResponse
45
+ from ..types.admin_issue_found_response import AdminIssueFoundResponse
46
+ from ..types.chat_delete_files_response import ChatDeleteFilesResponse
47
+ from ..types.chat_session_with_messages import ChatSessionWithMessages
48
+ from ..types.update_visibility_response import UpdateVisibilityResponse
49
+ from ..types.admin_grant_access_response import AdminGrantAccessResponse
36
50
  from ..types.list_chat_sessions_response import ListChatSessionsResponse
37
51
  from ..types.list_collaborators_response import ListCollaboratorsResponse
38
52
  from ..types.chat_add_git_commit_response import ChatAddGitCommitResponse
39
53
  from ..types.chat_get_git_commit_response import ChatGetGitCommitResponse
54
+ from ..types.chat_list_templates_response import ChatListTemplatesResponse
40
55
  from ..types.create_chat_session_response import CreateChatSessionResponse
41
56
  from ..types.delete_chat_session_response import DeleteChatSessionResponse
57
+ from ..types.chat_revert_to_commit_response import ChatRevertToCommitResponse
58
+ from ..types.chat_get_partial_chats_response import ChatGetPartialChatsResponse
42
59
  from ..types.chat_get_session_timeline_response import ChatGetSessionTimelineResponse
43
60
 
44
61
  __all__ = ["ChatResource", "AsyncChatResource"]
@@ -68,14 +85,14 @@ class ChatResource(SyncAPIResource):
68
85
  self,
69
86
  chat_id: str,
70
87
  *,
88
+ email: str,
71
89
  role: ChatSessionRole,
72
- user_id: str,
73
90
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
74
91
  # The extra values given here take precedence over values defined on the client or passed to this method.
75
92
  extra_headers: Headers | None = None,
76
93
  extra_query: Query | None = None,
77
94
  extra_body: Body | None = None,
78
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
95
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
79
96
  ) -> None:
80
97
  """
81
98
  Args:
@@ -94,8 +111,8 @@ class ChatResource(SyncAPIResource):
94
111
  f"/chat/sessions/{chat_id}/collaborators",
95
112
  body=maybe_transform(
96
113
  {
114
+ "email": email,
97
115
  "role": role,
98
- "user_id": user_id,
99
116
  },
100
117
  chat_add_collaborator_params.ChatAddCollaboratorParams,
101
118
  ),
@@ -115,7 +132,7 @@ class ChatResource(SyncAPIResource):
115
132
  extra_headers: Headers | None = None,
116
133
  extra_query: Query | None = None,
117
134
  extra_body: Body | None = None,
118
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
135
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
119
136
  ) -> ChatAddGitCommitResponse:
120
137
  """
121
138
  Add a git commit to a chat session
@@ -142,21 +159,20 @@ class ChatResource(SyncAPIResource):
142
159
  cast_to=ChatAddGitCommitResponse,
143
160
  )
144
161
 
145
- def add_message(
162
+ def admin_get_chat_prompt(
146
163
  self,
147
164
  session_id: str,
148
165
  *,
149
- content: str,
150
- role: str,
151
166
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
152
167
  # The extra values given here take precedence over values defined on the client or passed to this method.
153
168
  extra_headers: Headers | None = None,
154
169
  extra_query: Query | None = None,
155
170
  extra_body: Body | None = None,
156
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
157
- ) -> AddChatMessageResponse:
171
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
172
+ ) -> ChatPrompt:
158
173
  """
159
- Add a message to a chat session
174
+ Get the actual chat prompt that the LLM will see on its next message (admin
175
+ only)
160
176
 
161
177
  Args:
162
178
  extra_headers: Send extra headers
@@ -169,19 +185,99 @@ class ChatResource(SyncAPIResource):
169
185
  """
170
186
  if not session_id:
171
187
  raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
188
+ return self._get(
189
+ f"/chat/sessions/{session_id}/admin/chat_prompt",
190
+ options=make_request_options(
191
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
192
+ ),
193
+ cast_to=ChatPrompt,
194
+ )
195
+
196
+ def admin_issue_found(
197
+ self,
198
+ chat_id: str,
199
+ *,
200
+ message: str,
201
+ title: str,
202
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
203
+ # The extra values given here take precedence over values defined on the client or passed to this method.
204
+ extra_headers: Headers | None = None,
205
+ extra_query: Query | None = None,
206
+ extra_body: Body | None = None,
207
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
208
+ ) -> AdminIssueFoundResponse:
209
+ """
210
+ Add an IssueFound tool call as an admin-only auto-review message
211
+
212
+ Args:
213
+ extra_headers: Send extra headers
214
+
215
+ extra_query: Add additional query parameters to the request
216
+
217
+ extra_body: Add additional JSON properties to the request
218
+
219
+ timeout: Override the client-level default timeout for this request, in seconds
220
+ """
221
+ if not chat_id:
222
+ raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
172
223
  return self._post(
173
- f"/chat/sessions/{session_id}/messages",
224
+ f"/chat/sessions/{chat_id}/admin/issue_found",
174
225
  body=maybe_transform(
175
226
  {
176
- "content": content,
177
- "role": role,
227
+ "message": message,
228
+ "title": title,
229
+ },
230
+ chat_admin_issue_found_params.ChatAdminIssueFoundParams,
231
+ ),
232
+ options=make_request_options(
233
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
234
+ ),
235
+ cast_to=AdminIssueFoundResponse,
236
+ )
237
+
238
+ def copy(
239
+ self,
240
+ *,
241
+ copy_name: str,
242
+ source_chat_id: str,
243
+ team_id: str,
244
+ copy_inputs: bool | Omit = omit,
245
+ project_id: Optional[str] | Omit = omit,
246
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
247
+ # The extra values given here take precedence over values defined on the client or passed to this method.
248
+ extra_headers: Headers | None = None,
249
+ extra_query: Query | None = None,
250
+ extra_body: Body | None = None,
251
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
252
+ ) -> ChatSessionWithMessages:
253
+ """
254
+ Copy a chat session with its workflows and git files
255
+
256
+ Args:
257
+ extra_headers: Send extra headers
258
+
259
+ extra_query: Add additional query parameters to the request
260
+
261
+ extra_body: Add additional JSON properties to the request
262
+
263
+ timeout: Override the client-level default timeout for this request, in seconds
264
+ """
265
+ return self._post(
266
+ "/chat/copy",
267
+ body=maybe_transform(
268
+ {
269
+ "copy_name": copy_name,
270
+ "source_chat_id": source_chat_id,
271
+ "team_id": team_id,
272
+ "copy_inputs": copy_inputs,
273
+ "project_id": project_id,
178
274
  },
179
- chat_add_message_params.ChatAddMessageParams,
275
+ chat_copy_params.ChatCopyParams,
180
276
  ),
181
277
  options=make_request_options(
182
278
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
183
279
  ),
184
- cast_to=AddChatMessageResponse,
280
+ cast_to=ChatSessionWithMessages,
185
281
  )
186
282
 
187
283
  def copy_node_output_by_code_hash(
@@ -189,13 +285,13 @@ class ChatResource(SyncAPIResource):
189
285
  session_id: str,
190
286
  *,
191
287
  code_md5_hash: str,
192
- new_node_id: Optional[str] | NotGiven = NOT_GIVEN,
288
+ new_node_id: str,
193
289
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194
290
  # The extra values given here take precedence over values defined on the client or passed to this method.
195
291
  extra_headers: Headers | None = None,
196
292
  extra_query: Query | None = None,
197
293
  extra_body: Body | None = None,
198
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
294
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
199
295
  ) -> str:
200
296
  """
201
297
  Args:
@@ -227,20 +323,24 @@ class ChatResource(SyncAPIResource):
227
323
  def create_session(
228
324
  self,
229
325
  *,
230
- git_application_token: str,
231
- initial_message: str,
232
- project_id: str,
326
+ team_id: str,
327
+ config: Optional[chat_create_session_params.Config] | Omit = omit,
328
+ ephemeral: Optional[bool] | Omit = omit,
329
+ initial_message: Optional[str] | Omit = omit,
330
+ project_id: Optional[str] | Omit = omit,
233
331
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
234
332
  # The extra values given here take precedence over values defined on the client or passed to this method.
235
333
  extra_headers: Headers | None = None,
236
334
  extra_query: Query | None = None,
237
335
  extra_body: Body | None = None,
238
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
336
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
239
337
  ) -> CreateChatSessionResponse:
240
338
  """
241
339
  Create a new chat session with an initial message
242
340
 
243
341
  Args:
342
+ config: Configuration for chat session with system prompt and LLM key
343
+
244
344
  extra_headers: Send extra headers
245
345
 
246
346
  extra_query: Add additional query parameters to the request
@@ -253,7 +353,9 @@ class ChatResource(SyncAPIResource):
253
353
  "/chat/sessions",
254
354
  body=maybe_transform(
255
355
  {
256
- "git_application_token": git_application_token,
356
+ "team_id": team_id,
357
+ "config": config,
358
+ "ephemeral": ephemeral,
257
359
  "initial_message": initial_message,
258
360
  "project_id": project_id,
259
361
  },
@@ -265,6 +367,41 @@ class ChatResource(SyncAPIResource):
265
367
  cast_to=CreateChatSessionResponse,
266
368
  )
267
369
 
370
+ def delete_files(
371
+ self,
372
+ chat_id: str,
373
+ *,
374
+ paths: SequenceNotStr[str],
375
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
376
+ # The extra values given here take precedence over values defined on the client or passed to this method.
377
+ extra_headers: Headers | None = None,
378
+ extra_query: Query | None = None,
379
+ extra_body: Body | None = None,
380
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
381
+ ) -> ChatDeleteFilesResponse:
382
+ """
383
+ Delete files from a chat session's git repository
384
+
385
+ Args:
386
+ extra_headers: Send extra headers
387
+
388
+ extra_query: Add additional query parameters to the request
389
+
390
+ extra_body: Add additional JSON properties to the request
391
+
392
+ timeout: Override the client-level default timeout for this request, in seconds
393
+ """
394
+ if not chat_id:
395
+ raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
396
+ return self._post(
397
+ f"/chat/files/delete/{chat_id}",
398
+ body=maybe_transform({"paths": paths}, chat_delete_files_params.ChatDeleteFilesParams),
399
+ options=make_request_options(
400
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
401
+ ),
402
+ cast_to=ChatDeleteFilesResponse,
403
+ )
404
+
268
405
  def delete_session(
269
406
  self,
270
407
  session_id: str,
@@ -274,7 +411,7 @@ class ChatResource(SyncAPIResource):
274
411
  extra_headers: Headers | None = None,
275
412
  extra_query: Query | None = None,
276
413
  extra_body: Body | None = None,
277
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
414
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
278
415
  ) -> DeleteChatSessionResponse:
279
416
  """
280
417
  Delete a chat session
@@ -298,6 +435,39 @@ class ChatResource(SyncAPIResource):
298
435
  cast_to=DeleteChatSessionResponse,
299
436
  )
300
437
 
438
+ def get_dependencies(
439
+ self,
440
+ session_id: str,
441
+ *,
442
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
443
+ # The extra values given here take precedence over values defined on the client or passed to this method.
444
+ extra_headers: Headers | None = None,
445
+ extra_query: Query | None = None,
446
+ extra_body: Body | None = None,
447
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
448
+ ) -> GetDependenciesResponse:
449
+ """
450
+ Get all dependencies for a chat session
451
+
452
+ Args:
453
+ extra_headers: Send extra headers
454
+
455
+ extra_query: Add additional query parameters to the request
456
+
457
+ extra_body: Add additional JSON properties to the request
458
+
459
+ timeout: Override the client-level default timeout for this request, in seconds
460
+ """
461
+ if not session_id:
462
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
463
+ return self._get(
464
+ f"/chat/sessions/{session_id}/dependencies",
465
+ options=make_request_options(
466
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
467
+ ),
468
+ cast_to=GetDependenciesResponse,
469
+ )
470
+
301
471
  def get_git_commit(
302
472
  self,
303
473
  commit_hash: str,
@@ -308,7 +478,7 @@ class ChatResource(SyncAPIResource):
308
478
  extra_headers: Headers | None = None,
309
479
  extra_query: Query | None = None,
310
480
  extra_body: Body | None = None,
311
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
481
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
312
482
  ) -> ChatGetGitCommitResponse:
313
483
  """
314
484
  Get a specific git commit by its hash for a chat session
@@ -334,6 +504,39 @@ class ChatResource(SyncAPIResource):
334
504
  cast_to=ChatGetGitCommitResponse,
335
505
  )
336
506
 
507
+ def get_partial_chats(
508
+ self,
509
+ chat_session_id: str,
510
+ *,
511
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
512
+ # The extra values given here take precedence over values defined on the client or passed to this method.
513
+ extra_headers: Headers | None = None,
514
+ extra_query: Query | None = None,
515
+ extra_body: Body | None = None,
516
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
517
+ ) -> ChatGetPartialChatsResponse:
518
+ """
519
+ Get all partial chats for a chat session
520
+
521
+ Args:
522
+ extra_headers: Send extra headers
523
+
524
+ extra_query: Add additional query parameters to the request
525
+
526
+ extra_body: Add additional JSON properties to the request
527
+
528
+ timeout: Override the client-level default timeout for this request, in seconds
529
+ """
530
+ if not chat_session_id:
531
+ raise ValueError(f"Expected a non-empty value for `chat_session_id` but received {chat_session_id!r}")
532
+ return self._get(
533
+ f"/chat/{chat_session_id}/partial-chats",
534
+ options=make_request_options(
535
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
536
+ ),
537
+ cast_to=ChatGetPartialChatsResponse,
538
+ )
539
+
337
540
  def get_session(
338
541
  self,
339
542
  session_id: str,
@@ -343,7 +546,7 @@ class ChatResource(SyncAPIResource):
343
546
  extra_headers: Headers | None = None,
344
547
  extra_query: Query | None = None,
345
548
  extra_body: Body | None = None,
346
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
549
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
347
550
  ) -> GetChatSessionResponse:
348
551
  """
349
552
  Get a chat session with all its messages
@@ -376,7 +579,7 @@ class ChatResource(SyncAPIResource):
376
579
  extra_headers: Headers | None = None,
377
580
  extra_query: Query | None = None,
378
581
  extra_body: Body | None = None,
379
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
582
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
380
583
  ) -> ChatGetSessionTimelineResponse:
381
584
  """
382
585
  Get chronological timeline of messages and commits for a chat session
@@ -400,6 +603,50 @@ class ChatResource(SyncAPIResource):
400
603
  cast_to=ChatGetSessionTimelineResponse,
401
604
  )
402
605
 
606
+ def grant_admin_override(
607
+ self,
608
+ chat_id: str,
609
+ *,
610
+ duration_hours: int,
611
+ role: ChatSessionRole,
612
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
613
+ # The extra values given here take precedence over values defined on the client or passed to this method.
614
+ extra_headers: Headers | None = None,
615
+ extra_query: Query | None = None,
616
+ extra_body: Body | None = None,
617
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
618
+ ) -> AdminGrantAccessResponse:
619
+ """
620
+ Grant temporary admin override access for the calling admin to a chat session
621
+
622
+ Args:
623
+ duration_hours: Duration in hours for the temporary access
624
+
625
+ extra_headers: Send extra headers
626
+
627
+ extra_query: Add additional query parameters to the request
628
+
629
+ extra_body: Add additional JSON properties to the request
630
+
631
+ timeout: Override the client-level default timeout for this request, in seconds
632
+ """
633
+ if not chat_id:
634
+ raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
635
+ return self._post(
636
+ f"/chat/sessions/{chat_id}/admin_override",
637
+ body=maybe_transform(
638
+ {
639
+ "duration_hours": duration_hours,
640
+ "role": role,
641
+ },
642
+ chat_grant_admin_override_params.ChatGrantAdminOverrideParams,
643
+ ),
644
+ options=make_request_options(
645
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
646
+ ),
647
+ cast_to=AdminGrantAccessResponse,
648
+ )
649
+
403
650
  def list_collaborators(
404
651
  self,
405
652
  chat_id: str,
@@ -409,7 +656,7 @@ class ChatResource(SyncAPIResource):
409
656
  extra_headers: Headers | None = None,
410
657
  extra_query: Query | None = None,
411
658
  extra_body: Body | None = None,
412
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
659
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
413
660
  ) -> ListCollaboratorsResponse:
414
661
  """
415
662
  List all users who have access to a chat session
@@ -436,20 +683,27 @@ class ChatResource(SyncAPIResource):
436
683
  def list_sessions(
437
684
  self,
438
685
  *,
439
- limit: Optional[int] | NotGiven = NOT_GIVEN,
686
+ team_id: str,
687
+ limit: Optional[int] | Omit = omit,
688
+ project_id: Optional[str] | Omit = omit,
440
689
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
441
690
  # The extra values given here take precedence over values defined on the client or passed to this method.
442
691
  extra_headers: Headers | None = None,
443
692
  extra_query: Query | None = None,
444
693
  extra_body: Body | None = None,
445
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
694
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
446
695
  ) -> ListChatSessionsResponse:
447
696
  """
448
- List all chat sessions for the authenticated user.
697
+ List all chat sessions for the authenticated user within a specific team and
698
+ project.
449
699
 
450
700
  Args:
701
+ team_id: Team ID to filter chat sessions
702
+
451
703
  limit: Maximum number of sessions to return (default: 50)
452
704
 
705
+ project_id: Project ID to filter chat sessions
706
+
453
707
  extra_headers: Send extra headers
454
708
 
455
709
  extra_query: Add additional query parameters to the request
@@ -465,11 +719,110 @@ class ChatResource(SyncAPIResource):
465
719
  extra_query=extra_query,
466
720
  extra_body=extra_body,
467
721
  timeout=timeout,
468
- query=maybe_transform({"limit": limit}, chat_list_sessions_params.ChatListSessionsParams),
722
+ query=maybe_transform(
723
+ {
724
+ "team_id": team_id,
725
+ "limit": limit,
726
+ "project_id": project_id,
727
+ },
728
+ chat_list_sessions_params.ChatListSessionsParams,
729
+ ),
469
730
  ),
470
731
  cast_to=ListChatSessionsResponse,
471
732
  )
472
733
 
734
+ def list_templates(
735
+ self,
736
+ *,
737
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
738
+ # The extra values given here take precedence over values defined on the client or passed to this method.
739
+ extra_headers: Headers | None = None,
740
+ extra_query: Query | None = None,
741
+ extra_body: Body | None = None,
742
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
743
+ ) -> ChatListTemplatesResponse:
744
+ """List active chat templates for the /chat page"""
745
+ return self._get(
746
+ "/chat/templates",
747
+ options=make_request_options(
748
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
749
+ ),
750
+ cast_to=ChatListTemplatesResponse,
751
+ )
752
+
753
+ def load_files(
754
+ self,
755
+ *,
756
+ chat_id: str,
757
+ commit_hash: Optional[str] | Omit = omit,
758
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
759
+ # The extra values given here take precedence over values defined on the client or passed to this method.
760
+ extra_headers: Headers | None = None,
761
+ extra_query: Query | None = None,
762
+ extra_body: Body | None = None,
763
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
764
+ ) -> ChatLoadFilesResponse:
765
+ """
766
+ Load files from a chat session's git repository
767
+
768
+ Args:
769
+ extra_headers: Send extra headers
770
+
771
+ extra_query: Add additional query parameters to the request
772
+
773
+ extra_body: Add additional JSON properties to the request
774
+
775
+ timeout: Override the client-level default timeout for this request, in seconds
776
+ """
777
+ return self._post(
778
+ "/chat/files/load",
779
+ body=maybe_transform(
780
+ {
781
+ "chat_id": chat_id,
782
+ "commit_hash": commit_hash,
783
+ },
784
+ chat_load_files_params.ChatLoadFilesParams,
785
+ ),
786
+ options=make_request_options(
787
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
788
+ ),
789
+ cast_to=ChatLoadFilesResponse,
790
+ )
791
+
792
+ def make_permanent(
793
+ self,
794
+ session_id: str,
795
+ *,
796
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
797
+ # The extra values given here take precedence over values defined on the client or passed to this method.
798
+ extra_headers: Headers | None = None,
799
+ extra_query: Query | None = None,
800
+ extra_body: Body | None = None,
801
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
802
+ ) -> None:
803
+ """
804
+ Make an ephemeral chat session permanent
805
+
806
+ Args:
807
+ extra_headers: Send extra headers
808
+
809
+ extra_query: Add additional query parameters to the request
810
+
811
+ extra_body: Add additional JSON properties to the request
812
+
813
+ timeout: Override the client-level default timeout for this request, in seconds
814
+ """
815
+ if not session_id:
816
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
817
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
818
+ return self._patch(
819
+ f"/chat/sessions/{session_id}/make-permanent",
820
+ options=make_request_options(
821
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
822
+ ),
823
+ cast_to=NoneType,
824
+ )
825
+
473
826
  def remove_collaborator(
474
827
  self,
475
828
  user_id: str,
@@ -480,7 +833,7 @@ class ChatResource(SyncAPIResource):
480
833
  extra_headers: Headers | None = None,
481
834
  extra_query: Query | None = None,
482
835
  extra_body: Body | None = None,
483
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
836
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
484
837
  ) -> None:
485
838
  """
486
839
  Args:
@@ -505,22 +858,24 @@ class ChatResource(SyncAPIResource):
505
858
  cast_to=NoneType,
506
859
  )
507
860
 
508
- def toggle_public(
861
+ def revert_to_commit(
509
862
  self,
510
863
  session_id: str,
511
864
  *,
512
- is_public: bool,
865
+ commit_hash: str,
513
866
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
514
867
  # The extra values given here take precedence over values defined on the client or passed to this method.
515
868
  extra_headers: Headers | None = None,
516
869
  extra_query: Query | None = None,
517
870
  extra_body: Body | None = None,
518
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
519
- ) -> TogglePublicResponse:
871
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
872
+ ) -> ChatRevertToCommitResponse:
520
873
  """
521
- Toggle public visibility of a chat session
874
+ Revert a chat session to a specific commit
522
875
 
523
876
  Args:
877
+ commit_hash: The git commit hash to revert to (must be 40 characters)
878
+
524
879
  extra_headers: Send extra headers
525
880
 
526
881
  extra_query: Add additional query parameters to the request
@@ -531,27 +886,28 @@ class ChatResource(SyncAPIResource):
531
886
  """
532
887
  if not session_id:
533
888
  raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
534
- return self._put(
535
- f"/chat/sessions/{session_id}/public",
536
- body=maybe_transform({"is_public": is_public}, chat_toggle_public_params.ChatTogglePublicParams),
889
+ return self._post(
890
+ f"/chat/sessions/{session_id}/revert",
891
+ body=maybe_transform({"commit_hash": commit_hash}, chat_revert_to_commit_params.ChatRevertToCommitParams),
537
892
  options=make_request_options(
538
893
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
539
894
  ),
540
- cast_to=TogglePublicResponse,
895
+ cast_to=ChatRevertToCommitResponse,
541
896
  )
542
897
 
543
898
  def update_session(
544
899
  self,
545
900
  session_id: str,
546
901
  *,
547
- is_favorite: Optional[bool] | NotGiven = NOT_GIVEN,
548
- name: Optional[str] | NotGiven = NOT_GIVEN,
902
+ name: Optional[str] | Omit = omit,
903
+ project_id: Optional[str] | Omit = omit,
904
+ skip_confirmations: Optional[bool] | Omit = omit,
549
905
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
550
906
  # The extra values given here take precedence over values defined on the client or passed to this method.
551
907
  extra_headers: Headers | None = None,
552
908
  extra_query: Query | None = None,
553
909
  extra_body: Body | None = None,
554
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
910
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
555
911
  ) -> ChatSession:
556
912
  """
557
913
  Args:
@@ -569,8 +925,9 @@ class ChatResource(SyncAPIResource):
569
925
  f"/chat/sessions/{session_id}",
570
926
  body=maybe_transform(
571
927
  {
572
- "is_favorite": is_favorite,
573
928
  "name": name,
929
+ "project_id": project_id,
930
+ "skip_confirmations": skip_confirmations,
574
931
  },
575
932
  chat_update_session_params.ChatUpdateSessionParams,
576
933
  ),
@@ -580,12 +937,82 @@ class ChatResource(SyncAPIResource):
580
937
  cast_to=ChatSession,
581
938
  )
582
939
 
583
-
584
- class AsyncChatResource(AsyncAPIResource):
585
- @cached_property
586
- def with_raw_response(self) -> AsyncChatResourceWithRawResponse:
587
- """
588
- This property can be used as a prefix for any HTTP method call to return
940
+ def update_session_favorite(
941
+ self,
942
+ session_id: str,
943
+ *,
944
+ is_favorite: bool,
945
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
946
+ # The extra values given here take precedence over values defined on the client or passed to this method.
947
+ extra_headers: Headers | None = None,
948
+ extra_query: Query | None = None,
949
+ extra_body: Body | None = None,
950
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
951
+ ) -> ChatSession:
952
+ """
953
+ Args:
954
+ extra_headers: Send extra headers
955
+
956
+ extra_query: Add additional query parameters to the request
957
+
958
+ extra_body: Add additional JSON properties to the request
959
+
960
+ timeout: Override the client-level default timeout for this request, in seconds
961
+ """
962
+ if not session_id:
963
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
964
+ return self._patch(
965
+ f"/chat/sessions/{session_id}/favorite",
966
+ body=maybe_transform(
967
+ {"is_favorite": is_favorite}, chat_update_session_favorite_params.ChatUpdateSessionFavoriteParams
968
+ ),
969
+ options=make_request_options(
970
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
971
+ ),
972
+ cast_to=ChatSession,
973
+ )
974
+
975
+ def update_visibility(
976
+ self,
977
+ session_id: str,
978
+ *,
979
+ visibility: ChatVisibility,
980
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
981
+ # The extra values given here take precedence over values defined on the client or passed to this method.
982
+ extra_headers: Headers | None = None,
983
+ extra_query: Query | None = None,
984
+ extra_body: Body | None = None,
985
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
986
+ ) -> UpdateVisibilityResponse:
987
+ """
988
+ Update visibility of a chat session
989
+
990
+ Args:
991
+ extra_headers: Send extra headers
992
+
993
+ extra_query: Add additional query parameters to the request
994
+
995
+ extra_body: Add additional JSON properties to the request
996
+
997
+ timeout: Override the client-level default timeout for this request, in seconds
998
+ """
999
+ if not session_id:
1000
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1001
+ return self._put(
1002
+ f"/chat/sessions/{session_id}/visibility",
1003
+ body=maybe_transform({"visibility": visibility}, chat_update_visibility_params.ChatUpdateVisibilityParams),
1004
+ options=make_request_options(
1005
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1006
+ ),
1007
+ cast_to=UpdateVisibilityResponse,
1008
+ )
1009
+
1010
+
1011
+ class AsyncChatResource(AsyncAPIResource):
1012
+ @cached_property
1013
+ def with_raw_response(self) -> AsyncChatResourceWithRawResponse:
1014
+ """
1015
+ This property can be used as a prefix for any HTTP method call to return
589
1016
  the raw response object instead of the parsed content.
590
1017
 
591
1018
  For more information, see https://www.github.com/StructifyAI/structify-python#accessing-raw-response-data-eg-headers
@@ -605,14 +1032,14 @@ class AsyncChatResource(AsyncAPIResource):
605
1032
  self,
606
1033
  chat_id: str,
607
1034
  *,
1035
+ email: str,
608
1036
  role: ChatSessionRole,
609
- user_id: str,
610
1037
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
611
1038
  # The extra values given here take precedence over values defined on the client or passed to this method.
612
1039
  extra_headers: Headers | None = None,
613
1040
  extra_query: Query | None = None,
614
1041
  extra_body: Body | None = None,
615
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1042
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
616
1043
  ) -> None:
617
1044
  """
618
1045
  Args:
@@ -631,8 +1058,8 @@ class AsyncChatResource(AsyncAPIResource):
631
1058
  f"/chat/sessions/{chat_id}/collaborators",
632
1059
  body=await async_maybe_transform(
633
1060
  {
1061
+ "email": email,
634
1062
  "role": role,
635
- "user_id": user_id,
636
1063
  },
637
1064
  chat_add_collaborator_params.ChatAddCollaboratorParams,
638
1065
  ),
@@ -652,7 +1079,7 @@ class AsyncChatResource(AsyncAPIResource):
652
1079
  extra_headers: Headers | None = None,
653
1080
  extra_query: Query | None = None,
654
1081
  extra_body: Body | None = None,
655
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1082
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
656
1083
  ) -> ChatAddGitCommitResponse:
657
1084
  """
658
1085
  Add a git commit to a chat session
@@ -668,34 +1095,410 @@ class AsyncChatResource(AsyncAPIResource):
668
1095
 
669
1096
  timeout: Override the client-level default timeout for this request, in seconds
670
1097
  """
671
- if not session_id:
672
- raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
673
- return await self._post(
674
- f"/chat/sessions/{session_id}/commits",
675
- body=await async_maybe_transform(
676
- {"commit_hash": commit_hash}, chat_add_git_commit_params.ChatAddGitCommitParams
677
- ),
1098
+ if not session_id:
1099
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1100
+ return await self._post(
1101
+ f"/chat/sessions/{session_id}/commits",
1102
+ body=await async_maybe_transform(
1103
+ {"commit_hash": commit_hash}, chat_add_git_commit_params.ChatAddGitCommitParams
1104
+ ),
1105
+ options=make_request_options(
1106
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1107
+ ),
1108
+ cast_to=ChatAddGitCommitResponse,
1109
+ )
1110
+
1111
+ async def admin_get_chat_prompt(
1112
+ self,
1113
+ session_id: str,
1114
+ *,
1115
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1116
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1117
+ extra_headers: Headers | None = None,
1118
+ extra_query: Query | None = None,
1119
+ extra_body: Body | None = None,
1120
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1121
+ ) -> ChatPrompt:
1122
+ """
1123
+ Get the actual chat prompt that the LLM will see on its next message (admin
1124
+ only)
1125
+
1126
+ Args:
1127
+ extra_headers: Send extra headers
1128
+
1129
+ extra_query: Add additional query parameters to the request
1130
+
1131
+ extra_body: Add additional JSON properties to the request
1132
+
1133
+ timeout: Override the client-level default timeout for this request, in seconds
1134
+ """
1135
+ if not session_id:
1136
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1137
+ return await self._get(
1138
+ f"/chat/sessions/{session_id}/admin/chat_prompt",
1139
+ options=make_request_options(
1140
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1141
+ ),
1142
+ cast_to=ChatPrompt,
1143
+ )
1144
+
1145
+ async def admin_issue_found(
1146
+ self,
1147
+ chat_id: str,
1148
+ *,
1149
+ message: str,
1150
+ title: str,
1151
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1152
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1153
+ extra_headers: Headers | None = None,
1154
+ extra_query: Query | None = None,
1155
+ extra_body: Body | None = None,
1156
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1157
+ ) -> AdminIssueFoundResponse:
1158
+ """
1159
+ Add an IssueFound tool call as an admin-only auto-review message
1160
+
1161
+ Args:
1162
+ extra_headers: Send extra headers
1163
+
1164
+ extra_query: Add additional query parameters to the request
1165
+
1166
+ extra_body: Add additional JSON properties to the request
1167
+
1168
+ timeout: Override the client-level default timeout for this request, in seconds
1169
+ """
1170
+ if not chat_id:
1171
+ raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
1172
+ return await self._post(
1173
+ f"/chat/sessions/{chat_id}/admin/issue_found",
1174
+ body=await async_maybe_transform(
1175
+ {
1176
+ "message": message,
1177
+ "title": title,
1178
+ },
1179
+ chat_admin_issue_found_params.ChatAdminIssueFoundParams,
1180
+ ),
1181
+ options=make_request_options(
1182
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1183
+ ),
1184
+ cast_to=AdminIssueFoundResponse,
1185
+ )
1186
+
1187
+ async def copy(
1188
+ self,
1189
+ *,
1190
+ copy_name: str,
1191
+ source_chat_id: str,
1192
+ team_id: str,
1193
+ copy_inputs: bool | Omit = omit,
1194
+ project_id: Optional[str] | Omit = omit,
1195
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1196
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1197
+ extra_headers: Headers | None = None,
1198
+ extra_query: Query | None = None,
1199
+ extra_body: Body | None = None,
1200
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1201
+ ) -> ChatSessionWithMessages:
1202
+ """
1203
+ Copy a chat session with its workflows and git files
1204
+
1205
+ Args:
1206
+ extra_headers: Send extra headers
1207
+
1208
+ extra_query: Add additional query parameters to the request
1209
+
1210
+ extra_body: Add additional JSON properties to the request
1211
+
1212
+ timeout: Override the client-level default timeout for this request, in seconds
1213
+ """
1214
+ return await self._post(
1215
+ "/chat/copy",
1216
+ body=await async_maybe_transform(
1217
+ {
1218
+ "copy_name": copy_name,
1219
+ "source_chat_id": source_chat_id,
1220
+ "team_id": team_id,
1221
+ "copy_inputs": copy_inputs,
1222
+ "project_id": project_id,
1223
+ },
1224
+ chat_copy_params.ChatCopyParams,
1225
+ ),
1226
+ options=make_request_options(
1227
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1228
+ ),
1229
+ cast_to=ChatSessionWithMessages,
1230
+ )
1231
+
1232
+ async def copy_node_output_by_code_hash(
1233
+ self,
1234
+ session_id: str,
1235
+ *,
1236
+ code_md5_hash: str,
1237
+ new_node_id: str,
1238
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1239
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1240
+ extra_headers: Headers | None = None,
1241
+ extra_query: Query | None = None,
1242
+ extra_body: Body | None = None,
1243
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1244
+ ) -> str:
1245
+ """
1246
+ Args:
1247
+ extra_headers: Send extra headers
1248
+
1249
+ extra_query: Add additional query parameters to the request
1250
+
1251
+ extra_body: Add additional JSON properties to the request
1252
+
1253
+ timeout: Override the client-level default timeout for this request, in seconds
1254
+ """
1255
+ if not session_id:
1256
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1257
+ return await self._post(
1258
+ f"/chat/sessions/{session_id}/nodes/by_code_hash",
1259
+ body=await async_maybe_transform(
1260
+ {
1261
+ "code_md5_hash": code_md5_hash,
1262
+ "new_node_id": new_node_id,
1263
+ },
1264
+ chat_copy_node_output_by_code_hash_params.ChatCopyNodeOutputByCodeHashParams,
1265
+ ),
1266
+ options=make_request_options(
1267
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1268
+ ),
1269
+ cast_to=str,
1270
+ )
1271
+
1272
+ async def create_session(
1273
+ self,
1274
+ *,
1275
+ team_id: str,
1276
+ config: Optional[chat_create_session_params.Config] | Omit = omit,
1277
+ ephemeral: Optional[bool] | Omit = omit,
1278
+ initial_message: Optional[str] | Omit = omit,
1279
+ project_id: Optional[str] | Omit = omit,
1280
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1281
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1282
+ extra_headers: Headers | None = None,
1283
+ extra_query: Query | None = None,
1284
+ extra_body: Body | None = None,
1285
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1286
+ ) -> CreateChatSessionResponse:
1287
+ """
1288
+ Create a new chat session with an initial message
1289
+
1290
+ Args:
1291
+ config: Configuration for chat session with system prompt and LLM key
1292
+
1293
+ extra_headers: Send extra headers
1294
+
1295
+ extra_query: Add additional query parameters to the request
1296
+
1297
+ extra_body: Add additional JSON properties to the request
1298
+
1299
+ timeout: Override the client-level default timeout for this request, in seconds
1300
+ """
1301
+ return await self._post(
1302
+ "/chat/sessions",
1303
+ body=await async_maybe_transform(
1304
+ {
1305
+ "team_id": team_id,
1306
+ "config": config,
1307
+ "ephemeral": ephemeral,
1308
+ "initial_message": initial_message,
1309
+ "project_id": project_id,
1310
+ },
1311
+ chat_create_session_params.ChatCreateSessionParams,
1312
+ ),
1313
+ options=make_request_options(
1314
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1315
+ ),
1316
+ cast_to=CreateChatSessionResponse,
1317
+ )
1318
+
1319
+ async def delete_files(
1320
+ self,
1321
+ chat_id: str,
1322
+ *,
1323
+ paths: SequenceNotStr[str],
1324
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1325
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1326
+ extra_headers: Headers | None = None,
1327
+ extra_query: Query | None = None,
1328
+ extra_body: Body | None = None,
1329
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1330
+ ) -> ChatDeleteFilesResponse:
1331
+ """
1332
+ Delete files from a chat session's git repository
1333
+
1334
+ Args:
1335
+ extra_headers: Send extra headers
1336
+
1337
+ extra_query: Add additional query parameters to the request
1338
+
1339
+ extra_body: Add additional JSON properties to the request
1340
+
1341
+ timeout: Override the client-level default timeout for this request, in seconds
1342
+ """
1343
+ if not chat_id:
1344
+ raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
1345
+ return await self._post(
1346
+ f"/chat/files/delete/{chat_id}",
1347
+ body=await async_maybe_transform({"paths": paths}, chat_delete_files_params.ChatDeleteFilesParams),
1348
+ options=make_request_options(
1349
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1350
+ ),
1351
+ cast_to=ChatDeleteFilesResponse,
1352
+ )
1353
+
1354
+ async def delete_session(
1355
+ self,
1356
+ session_id: str,
1357
+ *,
1358
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1359
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1360
+ extra_headers: Headers | None = None,
1361
+ extra_query: Query | None = None,
1362
+ extra_body: Body | None = None,
1363
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1364
+ ) -> DeleteChatSessionResponse:
1365
+ """
1366
+ Delete a chat session
1367
+
1368
+ Args:
1369
+ extra_headers: Send extra headers
1370
+
1371
+ extra_query: Add additional query parameters to the request
1372
+
1373
+ extra_body: Add additional JSON properties to the request
1374
+
1375
+ timeout: Override the client-level default timeout for this request, in seconds
1376
+ """
1377
+ if not session_id:
1378
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1379
+ return await self._delete(
1380
+ f"/chat/sessions/{session_id}",
1381
+ options=make_request_options(
1382
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1383
+ ),
1384
+ cast_to=DeleteChatSessionResponse,
1385
+ )
1386
+
1387
+ async def get_dependencies(
1388
+ self,
1389
+ session_id: str,
1390
+ *,
1391
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1392
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1393
+ extra_headers: Headers | None = None,
1394
+ extra_query: Query | None = None,
1395
+ extra_body: Body | None = None,
1396
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1397
+ ) -> GetDependenciesResponse:
1398
+ """
1399
+ Get all dependencies for a chat session
1400
+
1401
+ Args:
1402
+ extra_headers: Send extra headers
1403
+
1404
+ extra_query: Add additional query parameters to the request
1405
+
1406
+ extra_body: Add additional JSON properties to the request
1407
+
1408
+ timeout: Override the client-level default timeout for this request, in seconds
1409
+ """
1410
+ if not session_id:
1411
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1412
+ return await self._get(
1413
+ f"/chat/sessions/{session_id}/dependencies",
1414
+ options=make_request_options(
1415
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1416
+ ),
1417
+ cast_to=GetDependenciesResponse,
1418
+ )
1419
+
1420
+ async def get_git_commit(
1421
+ self,
1422
+ commit_hash: str,
1423
+ *,
1424
+ chat_id: str,
1425
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1426
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1427
+ extra_headers: Headers | None = None,
1428
+ extra_query: Query | None = None,
1429
+ extra_body: Body | None = None,
1430
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1431
+ ) -> ChatGetGitCommitResponse:
1432
+ """
1433
+ Get a specific git commit by its hash for a chat session
1434
+
1435
+ Args:
1436
+ extra_headers: Send extra headers
1437
+
1438
+ extra_query: Add additional query parameters to the request
1439
+
1440
+ extra_body: Add additional JSON properties to the request
1441
+
1442
+ timeout: Override the client-level default timeout for this request, in seconds
1443
+ """
1444
+ if not chat_id:
1445
+ raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
1446
+ if not commit_hash:
1447
+ raise ValueError(f"Expected a non-empty value for `commit_hash` but received {commit_hash!r}")
1448
+ return await self._get(
1449
+ f"/chat/sessions/{chat_id}/commits/{commit_hash}",
1450
+ options=make_request_options(
1451
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1452
+ ),
1453
+ cast_to=ChatGetGitCommitResponse,
1454
+ )
1455
+
1456
+ async def get_partial_chats(
1457
+ self,
1458
+ chat_session_id: str,
1459
+ *,
1460
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1461
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1462
+ extra_headers: Headers | None = None,
1463
+ extra_query: Query | None = None,
1464
+ extra_body: Body | None = None,
1465
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1466
+ ) -> ChatGetPartialChatsResponse:
1467
+ """
1468
+ Get all partial chats for a chat session
1469
+
1470
+ Args:
1471
+ extra_headers: Send extra headers
1472
+
1473
+ extra_query: Add additional query parameters to the request
1474
+
1475
+ extra_body: Add additional JSON properties to the request
1476
+
1477
+ timeout: Override the client-level default timeout for this request, in seconds
1478
+ """
1479
+ if not chat_session_id:
1480
+ raise ValueError(f"Expected a non-empty value for `chat_session_id` but received {chat_session_id!r}")
1481
+ return await self._get(
1482
+ f"/chat/{chat_session_id}/partial-chats",
678
1483
  options=make_request_options(
679
1484
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
680
1485
  ),
681
- cast_to=ChatAddGitCommitResponse,
1486
+ cast_to=ChatGetPartialChatsResponse,
682
1487
  )
683
1488
 
684
- async def add_message(
1489
+ async def get_session(
685
1490
  self,
686
1491
  session_id: str,
687
1492
  *,
688
- content: str,
689
- role: str,
690
1493
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
691
1494
  # The extra values given here take precedence over values defined on the client or passed to this method.
692
1495
  extra_headers: Headers | None = None,
693
1496
  extra_query: Query | None = None,
694
1497
  extra_body: Body | None = None,
695
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
696
- ) -> AddChatMessageResponse:
1498
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1499
+ ) -> GetChatSessionResponse:
697
1500
  """
698
- Add a message to a chat session
1501
+ Get a chat session with all its messages
699
1502
 
700
1503
  Args:
701
1504
  extra_headers: Send extra headers
@@ -708,35 +1511,28 @@ class AsyncChatResource(AsyncAPIResource):
708
1511
  """
709
1512
  if not session_id:
710
1513
  raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
711
- return await self._post(
712
- f"/chat/sessions/{session_id}/messages",
713
- body=await async_maybe_transform(
714
- {
715
- "content": content,
716
- "role": role,
717
- },
718
- chat_add_message_params.ChatAddMessageParams,
719
- ),
1514
+ return await self._get(
1515
+ f"/chat/sessions/{session_id}",
720
1516
  options=make_request_options(
721
1517
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
722
1518
  ),
723
- cast_to=AddChatMessageResponse,
1519
+ cast_to=GetChatSessionResponse,
724
1520
  )
725
1521
 
726
- async def copy_node_output_by_code_hash(
1522
+ async def get_session_timeline(
727
1523
  self,
728
1524
  session_id: str,
729
1525
  *,
730
- code_md5_hash: str,
731
- new_node_id: Optional[str] | NotGiven = NOT_GIVEN,
732
1526
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
733
1527
  # The extra values given here take precedence over values defined on the client or passed to this method.
734
1528
  extra_headers: Headers | None = None,
735
1529
  extra_query: Query | None = None,
736
1530
  extra_body: Body | None = None,
737
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
738
- ) -> str:
1531
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1532
+ ) -> ChatGetSessionTimelineResponse:
739
1533
  """
1534
+ Get chronological timeline of messages and commits for a chat session
1535
+
740
1536
  Args:
741
1537
  extra_headers: Send extra headers
742
1538
 
@@ -748,38 +1544,33 @@ class AsyncChatResource(AsyncAPIResource):
748
1544
  """
749
1545
  if not session_id:
750
1546
  raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
751
- return await self._post(
752
- f"/chat/sessions/{session_id}/nodes/by_code_hash",
753
- body=await async_maybe_transform(
754
- {
755
- "code_md5_hash": code_md5_hash,
756
- "new_node_id": new_node_id,
757
- },
758
- chat_copy_node_output_by_code_hash_params.ChatCopyNodeOutputByCodeHashParams,
759
- ),
1547
+ return await self._get(
1548
+ f"/chat/sessions/{session_id}/timeline",
760
1549
  options=make_request_options(
761
1550
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
762
1551
  ),
763
- cast_to=str,
1552
+ cast_to=ChatGetSessionTimelineResponse,
764
1553
  )
765
1554
 
766
- async def create_session(
1555
+ async def grant_admin_override(
767
1556
  self,
1557
+ chat_id: str,
768
1558
  *,
769
- git_application_token: str,
770
- initial_message: str,
771
- project_id: str,
1559
+ duration_hours: int,
1560
+ role: ChatSessionRole,
772
1561
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
773
1562
  # The extra values given here take precedence over values defined on the client or passed to this method.
774
1563
  extra_headers: Headers | None = None,
775
1564
  extra_query: Query | None = None,
776
1565
  extra_body: Body | None = None,
777
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
778
- ) -> CreateChatSessionResponse:
1566
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1567
+ ) -> AdminGrantAccessResponse:
779
1568
  """
780
- Create a new chat session with an initial message
1569
+ Grant temporary admin override access for the calling admin to a chat session
781
1570
 
782
1571
  Args:
1572
+ duration_hours: Duration in hours for the temporary access
1573
+
783
1574
  extra_headers: Send extra headers
784
1575
 
785
1576
  extra_query: Add additional query parameters to the request
@@ -788,35 +1579,36 @@ class AsyncChatResource(AsyncAPIResource):
788
1579
 
789
1580
  timeout: Override the client-level default timeout for this request, in seconds
790
1581
  """
1582
+ if not chat_id:
1583
+ raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
791
1584
  return await self._post(
792
- "/chat/sessions",
1585
+ f"/chat/sessions/{chat_id}/admin_override",
793
1586
  body=await async_maybe_transform(
794
1587
  {
795
- "git_application_token": git_application_token,
796
- "initial_message": initial_message,
797
- "project_id": project_id,
1588
+ "duration_hours": duration_hours,
1589
+ "role": role,
798
1590
  },
799
- chat_create_session_params.ChatCreateSessionParams,
1591
+ chat_grant_admin_override_params.ChatGrantAdminOverrideParams,
800
1592
  ),
801
1593
  options=make_request_options(
802
1594
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
803
1595
  ),
804
- cast_to=CreateChatSessionResponse,
1596
+ cast_to=AdminGrantAccessResponse,
805
1597
  )
806
1598
 
807
- async def delete_session(
1599
+ async def list_collaborators(
808
1600
  self,
809
- session_id: str,
1601
+ chat_id: str,
810
1602
  *,
811
1603
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
812
1604
  # The extra values given here take precedence over values defined on the client or passed to this method.
813
1605
  extra_headers: Headers | None = None,
814
1606
  extra_query: Query | None = None,
815
1607
  extra_body: Body | None = None,
816
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
817
- ) -> DeleteChatSessionResponse:
1608
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1609
+ ) -> ListCollaboratorsResponse:
818
1610
  """
819
- Delete a chat session
1611
+ List all users who have access to a chat session
820
1612
 
821
1613
  Args:
822
1614
  extra_headers: Send extra headers
@@ -827,32 +1619,40 @@ class AsyncChatResource(AsyncAPIResource):
827
1619
 
828
1620
  timeout: Override the client-level default timeout for this request, in seconds
829
1621
  """
830
- if not session_id:
831
- raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
832
- return await self._delete(
833
- f"/chat/sessions/{session_id}",
1622
+ if not chat_id:
1623
+ raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
1624
+ return await self._get(
1625
+ f"/chat/sessions/{chat_id}/collaborators",
834
1626
  options=make_request_options(
835
1627
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
836
1628
  ),
837
- cast_to=DeleteChatSessionResponse,
1629
+ cast_to=ListCollaboratorsResponse,
838
1630
  )
839
1631
 
840
- async def get_git_commit(
1632
+ async def list_sessions(
841
1633
  self,
842
- commit_hash: str,
843
1634
  *,
844
- chat_id: str,
1635
+ team_id: str,
1636
+ limit: Optional[int] | Omit = omit,
1637
+ project_id: Optional[str] | Omit = omit,
845
1638
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
846
1639
  # The extra values given here take precedence over values defined on the client or passed to this method.
847
1640
  extra_headers: Headers | None = None,
848
1641
  extra_query: Query | None = None,
849
1642
  extra_body: Body | None = None,
850
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
851
- ) -> ChatGetGitCommitResponse:
1643
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1644
+ ) -> ListChatSessionsResponse:
852
1645
  """
853
- Get a specific git commit by its hash for a chat session
1646
+ List all chat sessions for the authenticated user within a specific team and
1647
+ project.
854
1648
 
855
1649
  Args:
1650
+ team_id: Team ID to filter chat sessions
1651
+
1652
+ limit: Maximum number of sessions to return (default: 50)
1653
+
1654
+ project_id: Project ID to filter chat sessions
1655
+
856
1656
  extra_headers: Send extra headers
857
1657
 
858
1658
  extra_query: Add additional query parameters to the request
@@ -861,31 +1661,58 @@ class AsyncChatResource(AsyncAPIResource):
861
1661
 
862
1662
  timeout: Override the client-level default timeout for this request, in seconds
863
1663
  """
864
- if not chat_id:
865
- raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
866
- if not commit_hash:
867
- raise ValueError(f"Expected a non-empty value for `commit_hash` but received {commit_hash!r}")
868
1664
  return await self._get(
869
- f"/chat/sessions/{chat_id}/commits/{commit_hash}",
1665
+ "/chat/sessions",
1666
+ options=make_request_options(
1667
+ extra_headers=extra_headers,
1668
+ extra_query=extra_query,
1669
+ extra_body=extra_body,
1670
+ timeout=timeout,
1671
+ query=await async_maybe_transform(
1672
+ {
1673
+ "team_id": team_id,
1674
+ "limit": limit,
1675
+ "project_id": project_id,
1676
+ },
1677
+ chat_list_sessions_params.ChatListSessionsParams,
1678
+ ),
1679
+ ),
1680
+ cast_to=ListChatSessionsResponse,
1681
+ )
1682
+
1683
+ async def list_templates(
1684
+ self,
1685
+ *,
1686
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1687
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1688
+ extra_headers: Headers | None = None,
1689
+ extra_query: Query | None = None,
1690
+ extra_body: Body | None = None,
1691
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1692
+ ) -> ChatListTemplatesResponse:
1693
+ """List active chat templates for the /chat page"""
1694
+ return await self._get(
1695
+ "/chat/templates",
870
1696
  options=make_request_options(
871
1697
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
872
1698
  ),
873
- cast_to=ChatGetGitCommitResponse,
1699
+ cast_to=ChatListTemplatesResponse,
874
1700
  )
875
1701
 
876
- async def get_session(
1702
+ async def load_files(
877
1703
  self,
878
- session_id: str,
879
1704
  *,
1705
+ chat_id: str,
1706
+ commit_hash: Optional[str] | Omit = omit,
880
1707
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
881
1708
  # The extra values given here take precedence over values defined on the client or passed to this method.
882
1709
  extra_headers: Headers | None = None,
883
1710
  extra_query: Query | None = None,
884
1711
  extra_body: Body | None = None,
885
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
886
- ) -> GetChatSessionResponse:
1712
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1713
+ ) -> ChatLoadFilesResponse:
887
1714
  """
888
- Get a chat session with all its messages
1715
+ Load files from a chat session's git repository
889
1716
 
890
1717
  Args:
891
1718
  extra_headers: Send extra headers
@@ -896,17 +1723,22 @@ class AsyncChatResource(AsyncAPIResource):
896
1723
 
897
1724
  timeout: Override the client-level default timeout for this request, in seconds
898
1725
  """
899
- if not session_id:
900
- raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
901
- return await self._get(
902
- f"/chat/sessions/{session_id}",
1726
+ return await self._post(
1727
+ "/chat/files/load",
1728
+ body=await async_maybe_transform(
1729
+ {
1730
+ "chat_id": chat_id,
1731
+ "commit_hash": commit_hash,
1732
+ },
1733
+ chat_load_files_params.ChatLoadFilesParams,
1734
+ ),
903
1735
  options=make_request_options(
904
1736
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
905
1737
  ),
906
- cast_to=GetChatSessionResponse,
1738
+ cast_to=ChatLoadFilesResponse,
907
1739
  )
908
1740
 
909
- async def get_session_timeline(
1741
+ async def make_permanent(
910
1742
  self,
911
1743
  session_id: str,
912
1744
  *,
@@ -915,10 +1747,10 @@ class AsyncChatResource(AsyncAPIResource):
915
1747
  extra_headers: Headers | None = None,
916
1748
  extra_query: Query | None = None,
917
1749
  extra_body: Body | None = None,
918
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
919
- ) -> ChatGetSessionTimelineResponse:
1750
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1751
+ ) -> None:
920
1752
  """
921
- Get chronological timeline of messages and commits for a chat session
1753
+ Make an ephemeral chat session permanent
922
1754
 
923
1755
  Args:
924
1756
  extra_headers: Send extra headers
@@ -931,28 +1763,28 @@ class AsyncChatResource(AsyncAPIResource):
931
1763
  """
932
1764
  if not session_id:
933
1765
  raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
934
- return await self._get(
935
- f"/chat/sessions/{session_id}/timeline",
1766
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
1767
+ return await self._patch(
1768
+ f"/chat/sessions/{session_id}/make-permanent",
936
1769
  options=make_request_options(
937
1770
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
938
1771
  ),
939
- cast_to=ChatGetSessionTimelineResponse,
1772
+ cast_to=NoneType,
940
1773
  )
941
1774
 
942
- async def list_collaborators(
1775
+ async def remove_collaborator(
943
1776
  self,
944
- chat_id: str,
1777
+ user_id: str,
945
1778
  *,
1779
+ chat_id: str,
946
1780
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
947
1781
  # The extra values given here take precedence over values defined on the client or passed to this method.
948
1782
  extra_headers: Headers | None = None,
949
1783
  extra_query: Query | None = None,
950
1784
  extra_body: Body | None = None,
951
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
952
- ) -> ListCollaboratorsResponse:
1785
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1786
+ ) -> None:
953
1787
  """
954
- List all users who have access to a chat session
955
-
956
1788
  Args:
957
1789
  extra_headers: Send extra headers
958
1790
 
@@ -964,30 +1796,34 @@ class AsyncChatResource(AsyncAPIResource):
964
1796
  """
965
1797
  if not chat_id:
966
1798
  raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
967
- return await self._get(
968
- f"/chat/sessions/{chat_id}/collaborators",
1799
+ if not user_id:
1800
+ raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}")
1801
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
1802
+ return await self._delete(
1803
+ f"/chat/sessions/{chat_id}/collaborators/{user_id}",
969
1804
  options=make_request_options(
970
1805
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
971
1806
  ),
972
- cast_to=ListCollaboratorsResponse,
1807
+ cast_to=NoneType,
973
1808
  )
974
1809
 
975
- async def list_sessions(
1810
+ async def revert_to_commit(
976
1811
  self,
1812
+ session_id: str,
977
1813
  *,
978
- limit: Optional[int] | NotGiven = NOT_GIVEN,
1814
+ commit_hash: str,
979
1815
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
980
1816
  # The extra values given here take precedence over values defined on the client or passed to this method.
981
1817
  extra_headers: Headers | None = None,
982
1818
  extra_query: Query | None = None,
983
1819
  extra_body: Body | None = None,
984
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
985
- ) -> ListChatSessionsResponse:
1820
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1821
+ ) -> ChatRevertToCommitResponse:
986
1822
  """
987
- List all chat sessions for the authenticated user.
1823
+ Revert a chat session to a specific commit
988
1824
 
989
1825
  Args:
990
- limit: Maximum number of sessions to return (default: 50)
1826
+ commit_hash: The git commit hash to revert to (must be 40 characters)
991
1827
 
992
1828
  extra_headers: Send extra headers
993
1829
 
@@ -997,30 +1833,33 @@ class AsyncChatResource(AsyncAPIResource):
997
1833
 
998
1834
  timeout: Override the client-level default timeout for this request, in seconds
999
1835
  """
1000
- return await self._get(
1001
- "/chat/sessions",
1836
+ if not session_id:
1837
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1838
+ return await self._post(
1839
+ f"/chat/sessions/{session_id}/revert",
1840
+ body=await async_maybe_transform(
1841
+ {"commit_hash": commit_hash}, chat_revert_to_commit_params.ChatRevertToCommitParams
1842
+ ),
1002
1843
  options=make_request_options(
1003
- extra_headers=extra_headers,
1004
- extra_query=extra_query,
1005
- extra_body=extra_body,
1006
- timeout=timeout,
1007
- query=await async_maybe_transform({"limit": limit}, chat_list_sessions_params.ChatListSessionsParams),
1844
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1008
1845
  ),
1009
- cast_to=ListChatSessionsResponse,
1846
+ cast_to=ChatRevertToCommitResponse,
1010
1847
  )
1011
1848
 
1012
- async def remove_collaborator(
1849
+ async def update_session(
1013
1850
  self,
1014
- user_id: str,
1851
+ session_id: str,
1015
1852
  *,
1016
- chat_id: str,
1853
+ name: Optional[str] | Omit = omit,
1854
+ project_id: Optional[str] | Omit = omit,
1855
+ skip_confirmations: Optional[bool] | Omit = omit,
1017
1856
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1018
1857
  # The extra values given here take precedence over values defined on the client or passed to this method.
1019
1858
  extra_headers: Headers | None = None,
1020
1859
  extra_query: Query | None = None,
1021
1860
  extra_body: Body | None = None,
1022
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1023
- ) -> None:
1861
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1862
+ ) -> ChatSession:
1024
1863
  """
1025
1864
  Args:
1026
1865
  extra_headers: Send extra headers
@@ -1031,34 +1870,37 @@ class AsyncChatResource(AsyncAPIResource):
1031
1870
 
1032
1871
  timeout: Override the client-level default timeout for this request, in seconds
1033
1872
  """
1034
- if not chat_id:
1035
- raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
1036
- if not user_id:
1037
- raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}")
1038
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
1039
- return await self._delete(
1040
- f"/chat/sessions/{chat_id}/collaborators/{user_id}",
1873
+ if not session_id:
1874
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1875
+ return await self._patch(
1876
+ f"/chat/sessions/{session_id}",
1877
+ body=await async_maybe_transform(
1878
+ {
1879
+ "name": name,
1880
+ "project_id": project_id,
1881
+ "skip_confirmations": skip_confirmations,
1882
+ },
1883
+ chat_update_session_params.ChatUpdateSessionParams,
1884
+ ),
1041
1885
  options=make_request_options(
1042
1886
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1043
1887
  ),
1044
- cast_to=NoneType,
1888
+ cast_to=ChatSession,
1045
1889
  )
1046
1890
 
1047
- async def toggle_public(
1891
+ async def update_session_favorite(
1048
1892
  self,
1049
1893
  session_id: str,
1050
1894
  *,
1051
- is_public: bool,
1895
+ is_favorite: bool,
1052
1896
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1053
1897
  # The extra values given here take precedence over values defined on the client or passed to this method.
1054
1898
  extra_headers: Headers | None = None,
1055
1899
  extra_query: Query | None = None,
1056
1900
  extra_body: Body | None = None,
1057
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1058
- ) -> TogglePublicResponse:
1901
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1902
+ ) -> ChatSession:
1059
1903
  """
1060
- Toggle public visibility of a chat session
1061
-
1062
1904
  Args:
1063
1905
  extra_headers: Send extra headers
1064
1906
 
@@ -1070,31 +1912,32 @@ class AsyncChatResource(AsyncAPIResource):
1070
1912
  """
1071
1913
  if not session_id:
1072
1914
  raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1073
- return await self._put(
1074
- f"/chat/sessions/{session_id}/public",
1915
+ return await self._patch(
1916
+ f"/chat/sessions/{session_id}/favorite",
1075
1917
  body=await async_maybe_transform(
1076
- {"is_public": is_public}, chat_toggle_public_params.ChatTogglePublicParams
1918
+ {"is_favorite": is_favorite}, chat_update_session_favorite_params.ChatUpdateSessionFavoriteParams
1077
1919
  ),
1078
1920
  options=make_request_options(
1079
1921
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1080
1922
  ),
1081
- cast_to=TogglePublicResponse,
1923
+ cast_to=ChatSession,
1082
1924
  )
1083
1925
 
1084
- async def update_session(
1926
+ async def update_visibility(
1085
1927
  self,
1086
1928
  session_id: str,
1087
1929
  *,
1088
- is_favorite: Optional[bool] | NotGiven = NOT_GIVEN,
1089
- name: Optional[str] | NotGiven = NOT_GIVEN,
1930
+ visibility: ChatVisibility,
1090
1931
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1091
1932
  # The extra values given here take precedence over values defined on the client or passed to this method.
1092
1933
  extra_headers: Headers | None = None,
1093
1934
  extra_query: Query | None = None,
1094
1935
  extra_body: Body | None = None,
1095
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1096
- ) -> ChatSession:
1936
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1937
+ ) -> UpdateVisibilityResponse:
1097
1938
  """
1939
+ Update visibility of a chat session
1940
+
1098
1941
  Args:
1099
1942
  extra_headers: Send extra headers
1100
1943
 
@@ -1106,19 +1949,15 @@ class AsyncChatResource(AsyncAPIResource):
1106
1949
  """
1107
1950
  if not session_id:
1108
1951
  raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
1109
- return await self._patch(
1110
- f"/chat/sessions/{session_id}",
1952
+ return await self._put(
1953
+ f"/chat/sessions/{session_id}/visibility",
1111
1954
  body=await async_maybe_transform(
1112
- {
1113
- "is_favorite": is_favorite,
1114
- "name": name,
1115
- },
1116
- chat_update_session_params.ChatUpdateSessionParams,
1955
+ {"visibility": visibility}, chat_update_visibility_params.ChatUpdateVisibilityParams
1117
1956
  ),
1118
1957
  options=make_request_options(
1119
1958
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1120
1959
  ),
1121
- cast_to=ChatSession,
1960
+ cast_to=UpdateVisibilityResponse,
1122
1961
  )
1123
1962
 
1124
1963
 
@@ -1132,8 +1971,14 @@ class ChatResourceWithRawResponse:
1132
1971
  self.add_git_commit = to_raw_response_wrapper(
1133
1972
  chat.add_git_commit,
1134
1973
  )
1135
- self.add_message = to_raw_response_wrapper(
1136
- chat.add_message,
1974
+ self.admin_get_chat_prompt = to_raw_response_wrapper(
1975
+ chat.admin_get_chat_prompt,
1976
+ )
1977
+ self.admin_issue_found = to_raw_response_wrapper(
1978
+ chat.admin_issue_found,
1979
+ )
1980
+ self.copy = to_raw_response_wrapper(
1981
+ chat.copy,
1137
1982
  )
1138
1983
  self.copy_node_output_by_code_hash = to_raw_response_wrapper(
1139
1984
  chat.copy_node_output_by_code_hash,
@@ -1141,33 +1986,60 @@ class ChatResourceWithRawResponse:
1141
1986
  self.create_session = to_raw_response_wrapper(
1142
1987
  chat.create_session,
1143
1988
  )
1989
+ self.delete_files = to_raw_response_wrapper(
1990
+ chat.delete_files,
1991
+ )
1144
1992
  self.delete_session = to_raw_response_wrapper(
1145
1993
  chat.delete_session,
1146
1994
  )
1995
+ self.get_dependencies = to_raw_response_wrapper(
1996
+ chat.get_dependencies,
1997
+ )
1147
1998
  self.get_git_commit = to_raw_response_wrapper(
1148
1999
  chat.get_git_commit,
1149
2000
  )
2001
+ self.get_partial_chats = to_raw_response_wrapper(
2002
+ chat.get_partial_chats,
2003
+ )
1150
2004
  self.get_session = to_raw_response_wrapper(
1151
2005
  chat.get_session,
1152
2006
  )
1153
2007
  self.get_session_timeline = to_raw_response_wrapper(
1154
2008
  chat.get_session_timeline,
1155
2009
  )
2010
+ self.grant_admin_override = to_raw_response_wrapper(
2011
+ chat.grant_admin_override,
2012
+ )
1156
2013
  self.list_collaborators = to_raw_response_wrapper(
1157
2014
  chat.list_collaborators,
1158
2015
  )
1159
2016
  self.list_sessions = to_raw_response_wrapper(
1160
2017
  chat.list_sessions,
1161
2018
  )
2019
+ self.list_templates = to_raw_response_wrapper(
2020
+ chat.list_templates,
2021
+ )
2022
+ self.load_files = to_raw_response_wrapper(
2023
+ chat.load_files,
2024
+ )
2025
+ self.make_permanent = to_raw_response_wrapper(
2026
+ chat.make_permanent,
2027
+ )
1162
2028
  self.remove_collaborator = to_raw_response_wrapper(
1163
2029
  chat.remove_collaborator,
1164
2030
  )
1165
- self.toggle_public = to_raw_response_wrapper(
1166
- chat.toggle_public,
2031
+ self.revert_to_commit = to_raw_response_wrapper(
2032
+ chat.revert_to_commit,
1167
2033
  )
1168
2034
  self.update_session = to_raw_response_wrapper(
1169
2035
  chat.update_session,
1170
2036
  )
2037
+ self.update_session_favorite = to_raw_response_wrapper(
2038
+ chat.update_session_favorite,
2039
+ )
2040
+ self.update_visibility = to_raw_response_wrapper(
2041
+ chat.update_visibility,
2042
+ )
1171
2043
 
1172
2044
 
1173
2045
  class AsyncChatResourceWithRawResponse:
@@ -1180,8 +2052,14 @@ class AsyncChatResourceWithRawResponse:
1180
2052
  self.add_git_commit = async_to_raw_response_wrapper(
1181
2053
  chat.add_git_commit,
1182
2054
  )
1183
- self.add_message = async_to_raw_response_wrapper(
1184
- chat.add_message,
2055
+ self.admin_get_chat_prompt = async_to_raw_response_wrapper(
2056
+ chat.admin_get_chat_prompt,
2057
+ )
2058
+ self.admin_issue_found = async_to_raw_response_wrapper(
2059
+ chat.admin_issue_found,
2060
+ )
2061
+ self.copy = async_to_raw_response_wrapper(
2062
+ chat.copy,
1185
2063
  )
1186
2064
  self.copy_node_output_by_code_hash = async_to_raw_response_wrapper(
1187
2065
  chat.copy_node_output_by_code_hash,
@@ -1189,33 +2067,60 @@ class AsyncChatResourceWithRawResponse:
1189
2067
  self.create_session = async_to_raw_response_wrapper(
1190
2068
  chat.create_session,
1191
2069
  )
2070
+ self.delete_files = async_to_raw_response_wrapper(
2071
+ chat.delete_files,
2072
+ )
1192
2073
  self.delete_session = async_to_raw_response_wrapper(
1193
2074
  chat.delete_session,
1194
2075
  )
2076
+ self.get_dependencies = async_to_raw_response_wrapper(
2077
+ chat.get_dependencies,
2078
+ )
1195
2079
  self.get_git_commit = async_to_raw_response_wrapper(
1196
2080
  chat.get_git_commit,
1197
2081
  )
2082
+ self.get_partial_chats = async_to_raw_response_wrapper(
2083
+ chat.get_partial_chats,
2084
+ )
1198
2085
  self.get_session = async_to_raw_response_wrapper(
1199
2086
  chat.get_session,
1200
2087
  )
1201
2088
  self.get_session_timeline = async_to_raw_response_wrapper(
1202
2089
  chat.get_session_timeline,
1203
2090
  )
2091
+ self.grant_admin_override = async_to_raw_response_wrapper(
2092
+ chat.grant_admin_override,
2093
+ )
1204
2094
  self.list_collaborators = async_to_raw_response_wrapper(
1205
2095
  chat.list_collaborators,
1206
2096
  )
1207
2097
  self.list_sessions = async_to_raw_response_wrapper(
1208
2098
  chat.list_sessions,
1209
2099
  )
2100
+ self.list_templates = async_to_raw_response_wrapper(
2101
+ chat.list_templates,
2102
+ )
2103
+ self.load_files = async_to_raw_response_wrapper(
2104
+ chat.load_files,
2105
+ )
2106
+ self.make_permanent = async_to_raw_response_wrapper(
2107
+ chat.make_permanent,
2108
+ )
1210
2109
  self.remove_collaborator = async_to_raw_response_wrapper(
1211
2110
  chat.remove_collaborator,
1212
2111
  )
1213
- self.toggle_public = async_to_raw_response_wrapper(
1214
- chat.toggle_public,
2112
+ self.revert_to_commit = async_to_raw_response_wrapper(
2113
+ chat.revert_to_commit,
1215
2114
  )
1216
2115
  self.update_session = async_to_raw_response_wrapper(
1217
2116
  chat.update_session,
1218
2117
  )
2118
+ self.update_session_favorite = async_to_raw_response_wrapper(
2119
+ chat.update_session_favorite,
2120
+ )
2121
+ self.update_visibility = async_to_raw_response_wrapper(
2122
+ chat.update_visibility,
2123
+ )
1219
2124
 
1220
2125
 
1221
2126
  class ChatResourceWithStreamingResponse:
@@ -1228,8 +2133,14 @@ class ChatResourceWithStreamingResponse:
1228
2133
  self.add_git_commit = to_streamed_response_wrapper(
1229
2134
  chat.add_git_commit,
1230
2135
  )
1231
- self.add_message = to_streamed_response_wrapper(
1232
- chat.add_message,
2136
+ self.admin_get_chat_prompt = to_streamed_response_wrapper(
2137
+ chat.admin_get_chat_prompt,
2138
+ )
2139
+ self.admin_issue_found = to_streamed_response_wrapper(
2140
+ chat.admin_issue_found,
2141
+ )
2142
+ self.copy = to_streamed_response_wrapper(
2143
+ chat.copy,
1233
2144
  )
1234
2145
  self.copy_node_output_by_code_hash = to_streamed_response_wrapper(
1235
2146
  chat.copy_node_output_by_code_hash,
@@ -1237,33 +2148,60 @@ class ChatResourceWithStreamingResponse:
1237
2148
  self.create_session = to_streamed_response_wrapper(
1238
2149
  chat.create_session,
1239
2150
  )
2151
+ self.delete_files = to_streamed_response_wrapper(
2152
+ chat.delete_files,
2153
+ )
1240
2154
  self.delete_session = to_streamed_response_wrapper(
1241
2155
  chat.delete_session,
1242
2156
  )
2157
+ self.get_dependencies = to_streamed_response_wrapper(
2158
+ chat.get_dependencies,
2159
+ )
1243
2160
  self.get_git_commit = to_streamed_response_wrapper(
1244
2161
  chat.get_git_commit,
1245
2162
  )
2163
+ self.get_partial_chats = to_streamed_response_wrapper(
2164
+ chat.get_partial_chats,
2165
+ )
1246
2166
  self.get_session = to_streamed_response_wrapper(
1247
2167
  chat.get_session,
1248
2168
  )
1249
2169
  self.get_session_timeline = to_streamed_response_wrapper(
1250
2170
  chat.get_session_timeline,
1251
2171
  )
2172
+ self.grant_admin_override = to_streamed_response_wrapper(
2173
+ chat.grant_admin_override,
2174
+ )
1252
2175
  self.list_collaborators = to_streamed_response_wrapper(
1253
2176
  chat.list_collaborators,
1254
2177
  )
1255
2178
  self.list_sessions = to_streamed_response_wrapper(
1256
2179
  chat.list_sessions,
1257
2180
  )
2181
+ self.list_templates = to_streamed_response_wrapper(
2182
+ chat.list_templates,
2183
+ )
2184
+ self.load_files = to_streamed_response_wrapper(
2185
+ chat.load_files,
2186
+ )
2187
+ self.make_permanent = to_streamed_response_wrapper(
2188
+ chat.make_permanent,
2189
+ )
1258
2190
  self.remove_collaborator = to_streamed_response_wrapper(
1259
2191
  chat.remove_collaborator,
1260
2192
  )
1261
- self.toggle_public = to_streamed_response_wrapper(
1262
- chat.toggle_public,
2193
+ self.revert_to_commit = to_streamed_response_wrapper(
2194
+ chat.revert_to_commit,
1263
2195
  )
1264
2196
  self.update_session = to_streamed_response_wrapper(
1265
2197
  chat.update_session,
1266
2198
  )
2199
+ self.update_session_favorite = to_streamed_response_wrapper(
2200
+ chat.update_session_favorite,
2201
+ )
2202
+ self.update_visibility = to_streamed_response_wrapper(
2203
+ chat.update_visibility,
2204
+ )
1267
2205
 
1268
2206
 
1269
2207
  class AsyncChatResourceWithStreamingResponse:
@@ -1276,8 +2214,14 @@ class AsyncChatResourceWithStreamingResponse:
1276
2214
  self.add_git_commit = async_to_streamed_response_wrapper(
1277
2215
  chat.add_git_commit,
1278
2216
  )
1279
- self.add_message = async_to_streamed_response_wrapper(
1280
- chat.add_message,
2217
+ self.admin_get_chat_prompt = async_to_streamed_response_wrapper(
2218
+ chat.admin_get_chat_prompt,
2219
+ )
2220
+ self.admin_issue_found = async_to_streamed_response_wrapper(
2221
+ chat.admin_issue_found,
2222
+ )
2223
+ self.copy = async_to_streamed_response_wrapper(
2224
+ chat.copy,
1281
2225
  )
1282
2226
  self.copy_node_output_by_code_hash = async_to_streamed_response_wrapper(
1283
2227
  chat.copy_node_output_by_code_hash,
@@ -1285,30 +2229,57 @@ class AsyncChatResourceWithStreamingResponse:
1285
2229
  self.create_session = async_to_streamed_response_wrapper(
1286
2230
  chat.create_session,
1287
2231
  )
2232
+ self.delete_files = async_to_streamed_response_wrapper(
2233
+ chat.delete_files,
2234
+ )
1288
2235
  self.delete_session = async_to_streamed_response_wrapper(
1289
2236
  chat.delete_session,
1290
2237
  )
2238
+ self.get_dependencies = async_to_streamed_response_wrapper(
2239
+ chat.get_dependencies,
2240
+ )
1291
2241
  self.get_git_commit = async_to_streamed_response_wrapper(
1292
2242
  chat.get_git_commit,
1293
2243
  )
2244
+ self.get_partial_chats = async_to_streamed_response_wrapper(
2245
+ chat.get_partial_chats,
2246
+ )
1294
2247
  self.get_session = async_to_streamed_response_wrapper(
1295
2248
  chat.get_session,
1296
2249
  )
1297
2250
  self.get_session_timeline = async_to_streamed_response_wrapper(
1298
2251
  chat.get_session_timeline,
1299
2252
  )
2253
+ self.grant_admin_override = async_to_streamed_response_wrapper(
2254
+ chat.grant_admin_override,
2255
+ )
1300
2256
  self.list_collaborators = async_to_streamed_response_wrapper(
1301
2257
  chat.list_collaborators,
1302
2258
  )
1303
2259
  self.list_sessions = async_to_streamed_response_wrapper(
1304
2260
  chat.list_sessions,
1305
2261
  )
2262
+ self.list_templates = async_to_streamed_response_wrapper(
2263
+ chat.list_templates,
2264
+ )
2265
+ self.load_files = async_to_streamed_response_wrapper(
2266
+ chat.load_files,
2267
+ )
2268
+ self.make_permanent = async_to_streamed_response_wrapper(
2269
+ chat.make_permanent,
2270
+ )
1306
2271
  self.remove_collaborator = async_to_streamed_response_wrapper(
1307
2272
  chat.remove_collaborator,
1308
2273
  )
1309
- self.toggle_public = async_to_streamed_response_wrapper(
1310
- chat.toggle_public,
2274
+ self.revert_to_commit = async_to_streamed_response_wrapper(
2275
+ chat.revert_to_commit,
1311
2276
  )
1312
2277
  self.update_session = async_to_streamed_response_wrapper(
1313
2278
  chat.update_session,
1314
2279
  )
2280
+ self.update_session_favorite = async_to_streamed_response_wrapper(
2281
+ chat.update_session_favorite,
2282
+ )
2283
+ self.update_visibility = async_to_streamed_response_wrapper(
2284
+ chat.update_visibility,
2285
+ )