mito-ai 0.1.57__py3-none-any.whl → 0.1.59__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 (92) hide show
  1. mito_ai/__init__.py +19 -22
  2. mito_ai/_version.py +1 -1
  3. mito_ai/anthropic_client.py +24 -14
  4. mito_ai/chart_wizard/handlers.py +78 -17
  5. mito_ai/chart_wizard/urls.py +8 -5
  6. mito_ai/completions/completion_handlers/agent_auto_error_fixup_handler.py +6 -8
  7. mito_ai/completions/completion_handlers/agent_execution_handler.py +6 -8
  8. mito_ai/completions/completion_handlers/chat_completion_handler.py +13 -17
  9. mito_ai/completions/completion_handlers/code_explain_handler.py +13 -17
  10. mito_ai/completions/completion_handlers/completion_handler.py +3 -5
  11. mito_ai/completions/completion_handlers/inline_completer_handler.py +5 -6
  12. mito_ai/completions/completion_handlers/scratchpad_result_handler.py +6 -8
  13. mito_ai/completions/completion_handlers/smart_debug_handler.py +13 -17
  14. mito_ai/completions/completion_handlers/utils.py +3 -7
  15. mito_ai/completions/handlers.py +32 -22
  16. mito_ai/completions/message_history.py +8 -10
  17. mito_ai/completions/prompt_builders/chart_add_field_prompt.py +35 -0
  18. mito_ai/completions/prompt_builders/prompt_constants.py +2 -0
  19. mito_ai/constants.py +31 -2
  20. mito_ai/enterprise/__init__.py +1 -1
  21. mito_ai/enterprise/litellm_client.py +144 -0
  22. mito_ai/enterprise/utils.py +16 -2
  23. mito_ai/log/handlers.py +1 -1
  24. mito_ai/openai_client.py +36 -96
  25. mito_ai/provider_manager.py +420 -0
  26. mito_ai/settings/enterprise_handler.py +26 -0
  27. mito_ai/settings/urls.py +2 -0
  28. mito_ai/streamlit_conversion/agent_utils.py +2 -30
  29. mito_ai/streamlit_conversion/streamlit_agent_handler.py +48 -46
  30. mito_ai/streamlit_preview/handlers.py +6 -3
  31. mito_ai/streamlit_preview/urls.py +5 -3
  32. mito_ai/tests/message_history/test_generate_short_chat_name.py +103 -28
  33. mito_ai/tests/open_ai_utils_test.py +34 -36
  34. mito_ai/tests/providers/test_anthropic_client.py +174 -16
  35. mito_ai/tests/providers/test_azure.py +15 -15
  36. mito_ai/tests/providers/test_capabilities.py +14 -17
  37. mito_ai/tests/providers/test_gemini_client.py +14 -13
  38. mito_ai/tests/providers/test_model_resolution.py +145 -89
  39. mito_ai/tests/providers/test_openai_client.py +209 -13
  40. mito_ai/tests/providers/test_provider_limits.py +5 -5
  41. mito_ai/tests/providers/test_providers.py +229 -51
  42. mito_ai/tests/providers/test_retry_logic.py +13 -22
  43. mito_ai/tests/providers/utils.py +4 -4
  44. mito_ai/tests/streamlit_conversion/test_streamlit_agent_handler.py +57 -85
  45. mito_ai/tests/streamlit_preview/test_streamlit_preview_handler.py +4 -1
  46. mito_ai/tests/test_constants.py +90 -0
  47. mito_ai/tests/test_enterprise_mode.py +217 -0
  48. mito_ai/tests/test_model_utils.py +362 -0
  49. mito_ai/utils/anthropic_utils.py +8 -6
  50. mito_ai/utils/gemini_utils.py +0 -3
  51. mito_ai/utils/litellm_utils.py +84 -0
  52. mito_ai/utils/model_utils.py +257 -0
  53. mito_ai/utils/open_ai_utils.py +29 -41
  54. mito_ai/utils/provider_utils.py +13 -29
  55. mito_ai/utils/telemetry_utils.py +14 -2
  56. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +102 -102
  57. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/package.json +2 -2
  58. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +1 -1
  59. mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.9d26322f3e78beb2b666.js → mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.44c109c7be36fb884d25.js +1059 -144
  60. mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.44c109c7be36fb884d25.js.map +1 -0
  61. mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.79c1ea8a3cda73a4cb6f.js → mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.f7decebaf69618541e0f.js +17 -17
  62. mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.79c1ea8a3cda73a4cb6f.js.map → mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.f7decebaf69618541e0f.js.map +1 -1
  63. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.css +78 -78
  64. {mito_ai-0.1.57.dist-info → mito_ai-0.1.59.dist-info}/METADATA +2 -1
  65. {mito_ai-0.1.57.dist-info → mito_ai-0.1.59.dist-info}/RECORD +90 -83
  66. mito_ai/completions/providers.py +0 -284
  67. mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.9d26322f3e78beb2b666.js.map +0 -1
  68. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
  69. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
  70. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js +0 -0
  71. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map +0 -0
  72. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
  73. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js +0 -0
  74. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js.map +0 -0
  75. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js +0 -0
  76. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js.map +0 -0
  77. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js +0 -0
  78. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js.map +0 -0
  79. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js +0 -0
  80. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map +0 -0
  81. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js +0 -0
  82. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js.map +0 -0
  83. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js +0 -0
  84. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js.map +0 -0
  85. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js +0 -0
  86. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map +0 -0
  87. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
  88. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
  89. {mito_ai-0.1.57.data → mito_ai-0.1.59.data}/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.js +0 -0
  90. {mito_ai-0.1.57.dist-info → mito_ai-0.1.59.dist-info}/WHEEL +0 -0
  91. {mito_ai-0.1.57.dist-info → mito_ai-0.1.59.dist-info}/entry_points.txt +0 -0
  92. {mito_ai-0.1.57.dist-info → mito_ai-0.1.59.dist-info}/licenses/LICENSE +0 -0
@@ -1,11 +1,12 @@
1
- mito_ai/__init__.py,sha256=iBzK_S6iBm403SNHhhFnuapvqmAH3h36XrQvY6ch0v8,5026
2
- mito_ai/_version.py,sha256=M1r8DtXf9kkJPFxKzTsjTVnijFXt6DfxUA0zzk6dz2s,172
3
- mito_ai/anthropic_client.py,sha256=f5O7lnQ3fC6LiRg4qT25SsGgcRCuO6fLXXicXFQ3iRY,14144
4
- mito_ai/constants.py,sha256=wP-J-srUgX2j8sbQ4nbFapalCrGZTX_k4u78ojYSHHY,2260
1
+ mito_ai/__init__.py,sha256=Jk75F6q8wyyfPh1B6J17gACmQLdryRnj44-_TLLUQHQ,5054
2
+ mito_ai/_version.py,sha256=ruca0MUTJPeI8V-_I_5oZK78ti_jkTckS43ACql-4nQ,172
3
+ mito_ai/anthropic_client.py,sha256=D67YqjoS6A962V4E3r8pr0n1AMeQehYmkc8psvM_gPc,15238
4
+ mito_ai/constants.py,sha256=CTYkasdAN_4mceqdsSHha6e2qEpnSCH9UEHnSYyhBuU,3500
5
5
  mito_ai/gemini_client.py,sha256=4L-h2yYc_p8cEOCMDYM0R-vD4aktfqN47siZH5ZjGJc,9771
6
6
  mito_ai/logger.py,sha256=ZJEC415ZHTodDYKgp8ezVg3c4O513oQZV5lSs708gp8,1285
7
- mito_ai/openai_client.py,sha256=ljLs-HmHX5IElVn-5GuLTLijVPzWKCzg0uA263K57Dw,14210
7
+ mito_ai/openai_client.py,sha256=HLldWrCoiEjvJrUdHA7fujcOC5Xq94MbS_SoWDLh1rQ,12422
8
8
  mito_ai/path_utils.py,sha256=1tFZBRChMAxFQjLrpbwc40o7wPhsXG3H1ad5n1gFOzM,2573
9
+ mito_ai/provider_manager.py,sha256=pll7dgYsHBRnNRbPTmYMZscV1NzmK3eJ_h1FKtR4tH4,18987
9
10
  mito_ai/version_check.py,sha256=871m9_Qj_UzYmxuByBcs8DIoonUb0uVqGTRmJYpw6Fk,2268
10
11
  mito_ai/app_deploy/__init__.py,sha256=Kn_8xI0wv_JVV6FRhLDKOuld2P01Lit8nR2zB0aIHN0,190
11
12
  mito_ai/app_deploy/app_deploy_utils.py,sha256=cnCayqP3WPfA4Lrz8Eo2h0lJbgBDgyfePriB-8wMeKA,1964
@@ -20,35 +21,35 @@ mito_ai/auth/__init__.py,sha256=CrNlpbSKMPcw40H7keblZ61aa_x8qqSXPAqrEq-yCqk,172
20
21
  mito_ai/auth/handlers.py,sha256=vpbLBsS_CIGVK3kZ_Pht4fjvRlde-z5kWQRc-jLjHe4,3888
21
22
  mito_ai/auth/urls.py,sha256=iO4ueOlmqt6Bc66mVX2OrSdFGWPcwqhvGU9Ur5__sUM,417
22
23
  mito_ai/chart_wizard/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
23
- mito_ai/chart_wizard/handlers.py,sha256=53coW_uR_bhq1zlgOtpEalyH1kYK7NI_dI5QLal-leo,2035
24
- mito_ai/chart_wizard/urls.py,sha256=gQjsDkTr7nEQOL4CIlfYM_y22wJQCZwSApR4c3mdirs,797
24
+ mito_ai/chart_wizard/handlers.py,sha256=xte8fow6TH9ciJrwKPilk4N7C5dmJpFM5eWXmhCIW7E,3959
25
+ mito_ai/chart_wizard/urls.py,sha256=lsMoB_k6aHXGEN4zgQR_TjzRBnq4wpBB7t9eNrUM1KE,906
25
26
  mito_ai/chat_history/handlers.py,sha256=zRH9oNiwf_x7bYaa0JPoodoMuWwcFzEvg9svAAzZtZc,2537
26
27
  mito_ai/chat_history/urls.py,sha256=WoXVkS3tn_wohT_6tQ5iLVF26llL697vmgkMb7xsvT0,1100
27
- mito_ai/completions/handlers.py,sha256=j806QnoGDPM1sf_t0gYbwMk9Eon-5atFBS4F7pGcaGw,18151
28
- mito_ai/completions/message_history.py,sha256=e-PZZd7fU2iQSH18tDsTb7J_QC56K29ZIIwivMQaVqk,17213
28
+ mito_ai/completions/handlers.py,sha256=lh6xfVX_EmXwWly-k7JegsDDfckD44oAt408RYhhWzg,18654
29
+ mito_ai/completions/message_history.py,sha256=kbZe_wwZD52CeDXPyxDo3VdRg4xT9yD6UGdPmK2wBVc,17079
29
30
  mito_ai/completions/models.py,sha256=DigsLKRefkJmov-lT_IbjSCerEM9jX3pCWSYKNxLHQ0,10846
30
- mito_ai/completions/providers.py,sha256=JcZZGxFDd5B2nwnwOuJICMhjLRpLFL8_QhomaepXb5c,11950
31
31
  mito_ai/completions/completion_handlers/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
32
- mito_ai/completions/completion_handlers/agent_auto_error_fixup_handler.py,sha256=Vu-SoOziFnWQjxomTpbnbZgxtLkvqPS4Etw2me6L94M,2810
33
- mito_ai/completions/completion_handlers/agent_execution_handler.py,sha256=QwZBnsLe__Tl1el5XMZgpz1AXKhA6n8dsXLZWd66shM,3027
34
- mito_ai/completions/completion_handlers/chat_completion_handler.py,sha256=4DMjn18KV7_YgwQVH5VmEPtBNver9M1qIh4vNzsqP_0,6210
35
- mito_ai/completions/completion_handlers/code_explain_handler.py,sha256=mkR-HJ0fEmzetJNgH20DKYSCL9Ax2o0WGu8limx9X_w,5074
36
- mito_ai/completions/completion_handlers/completion_handler.py,sha256=E1HFeY6aVGeVU5u9r3VSiogDf3MkGsUqDx5IMFckYe8,1747
37
- mito_ai/completions/completion_handlers/inline_completer_handler.py,sha256=IR9xPA6YggdHQkdXVEcWqXZy8GXphqYRHkTfOcdEphw,1808
38
- mito_ai/completions/completion_handlers/scratchpad_result_handler.py,sha256=WWkeUpILbASdchTpjPFoj8MjXeINKXjUCKLUHiw3Mi8,2959
39
- mito_ai/completions/completion_handlers/smart_debug_handler.py,sha256=5DH4NR9YB28YoQOUbFFcF7bip11cFzmzrcap_bZGLwA,6388
40
- mito_ai/completions/completion_handlers/utils.py,sha256=Bk-EX9gj_riRQrBC5Bjp5ceFbgymgBDmNXa1SZ9Vt1M,4389
32
+ mito_ai/completions/completion_handlers/agent_auto_error_fixup_handler.py,sha256=q9xqnOEB2u0FeOly0sqWFVOfh3qxYzKdPznMAn6wmJE,2741
33
+ mito_ai/completions/completion_handlers/agent_execution_handler.py,sha256=weB1zHGPoHGYvoiLgJF2bXsIi9yNXJVfIxYaU8ty22c,2958
34
+ mito_ai/completions/completion_handlers/chat_completion_handler.py,sha256=P29PxfS4MHhC4jk_KDegzzVNqsktq4ISS84OUcnZFc8,6076
35
+ mito_ai/completions/completion_handlers/code_explain_handler.py,sha256=xIrPn1lRBU2mG0cZo5515E8umIqYW0NwHlnOcYN8hV8,4940
36
+ mito_ai/completions/completion_handlers/completion_handler.py,sha256=fKG0IIoJWJb4U4EYC25kF7YOXz2sCooI5jGoICbqe1Y,1669
37
+ mito_ai/completions/completion_handlers/inline_completer_handler.py,sha256=1JBw-I6HhAScV4EExkI4Rv8i92N5z_jv2D_0fgv9CAw,1793
38
+ mito_ai/completions/completion_handlers/scratchpad_result_handler.py,sha256=4GpZGDUPKH3lJpiCIFW9MHXH8Il0-De3BM8RXRvs2y4,2890
39
+ mito_ai/completions/completion_handlers/smart_debug_handler.py,sha256=RqX0DxAaW2F8UHePa6lS8Jgci9mCOYZo9BLfS-vQnI4,6254
40
+ mito_ai/completions/completion_handlers/utils.py,sha256=IxYj9cp_mfk9GdqmMwibNMDP3Qx620XdRtw0Orqgl2w,4313
41
41
  mito_ai/completions/prompt_builders/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
42
42
  mito_ai/completions/prompt_builders/agent_execution_prompt.py,sha256=onj6u6s6bF5XdN_2lSOnYyMIaype8Pk_d3HLHTZv0-U,1034
43
43
  mito_ai/completions/prompt_builders/agent_smart_debug_prompt.py,sha256=6uiosUsNNlzqFLnj2vNnTmWwISc3GY4lPTuZR8pJeFU,7483
44
44
  mito_ai/completions/prompt_builders/agent_system_message.py,sha256=n8Is8xk1sXW0iwO9KXFT6MCbIjBaYC_EDzD5IfL4fXA,36481
45
+ mito_ai/completions/prompt_builders/chart_add_field_prompt.py,sha256=VM1WzeV1xta0-qT9yLNOQLodcQYrTBQm4LyRToxdkiI,2070
45
46
  mito_ai/completions/prompt_builders/chart_conversion_prompt.py,sha256=wulJt0I2xbb7ciZSXO80q6yTw1ZxXUUc7Liayywmq3g,1215
46
47
  mito_ai/completions/prompt_builders/chat_name_prompt.py,sha256=ERwgDUAnd7VH3drjbUh70zbP3iEUct1PdJ9EZvMi3qE,532
47
48
  mito_ai/completions/prompt_builders/chat_prompt.py,sha256=ozgbzjXaiXLFcmctu07Wmj1ZhK-7u9WV1-_fqyGV8Ww,1143
48
49
  mito_ai/completions/prompt_builders/chat_system_message.py,sha256=OoY_CHPD_uG3XIGQMMD4PAsueVyFVjg9UAWkpfO8owM,7775
49
50
  mito_ai/completions/prompt_builders/explain_code_prompt.py,sha256=jN5bX4TqdE0YbcaHxBQOFqryTiv_Gl-m8gNZN7Bju-Q,1178
50
51
  mito_ai/completions/prompt_builders/inline_completer_prompt.py,sha256=9j8tOn3wIxVTYyje-oadPidHtdrXdXY8Q89kN-nFXu8,5082
51
- mito_ai/completions/prompt_builders/prompt_constants.py,sha256=p94EnIW_LYC7TR2-_TYTyEoQc2LjeY33oVD9RrKezZs,9939
52
+ mito_ai/completions/prompt_builders/prompt_constants.py,sha256=tzX4k8J3Menfm6xLHyr3u-XV_wj27J5U3DXR4TvILug,10143
52
53
  mito_ai/completions/prompt_builders/scratchpad_result_prompt.py,sha256=vpU7_vLXpzfqC1QIaLMPZ7mImKiqmbuzn5RS_uBdRDc,758
53
54
  mito_ai/completions/prompt_builders/smart_debug_prompt.py,sha256=2FdH_BAlXOMozbLRHN3q_fkcdhHRwGK7tTKpR1Xu98Y,6676
54
55
  mito_ai/completions/prompt_builders/prompt_section_registry/__init__.py,sha256=laS2z7BwYCQXeBzqXZEbbb1w8MOm7Rgko5yWUwNlW9A,2598
@@ -84,22 +85,24 @@ mito_ai/docker/oracle/compose.yml,sha256=6mgV7SmP3IenFwzY4f3JKCI1f1PDVlYqInDxjIq
84
85
  mito_ai/docker/oracle/init/setup.sql,sha256=d8xZ236OdMneN_ziZbOzxl5-rUI7eET1kmd2pDppbdg,1135
85
86
  mito_ai/docker/postgres/compose.yml,sha256=pp1fG2YfYbDpHuedkpcnAkRu0HJs_uibBn2CnQwrZYA,467
86
87
  mito_ai/docker/postgres/init/setup.sql,sha256=l--Ra5FNfR-24I-HdZWpqzqrERxF1jNOIzdrpVlMRFM,356
87
- mito_ai/enterprise/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
88
- mito_ai/enterprise/utils.py,sha256=Skdg9YahsnixKfBMXLneJmzn7yTi1QbvTjBxESV2dmw,652
88
+ mito_ai/enterprise/__init__.py,sha256=qd39u6KdG0zeYRT2_aNlY13_lDqE6ZUSYv9JfgtT04s,115
89
+ mito_ai/enterprise/litellm_client.py,sha256=hdMJIVFEu9_vRRZT93lMzgxyS_VXuulmS9o4CoHRyUM,5597
90
+ mito_ai/enterprise/utils.py,sha256=l1oaHdomIihOGEGB2bYyl46p9fCFkcqXHGUjGdlriHg,957
89
91
  mito_ai/file_uploads/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
90
92
  mito_ai/file_uploads/handlers.py,sha256=_mmEmCoQTAWHzPXKScEdRIrp5imoZMYgmaD-O6OAhfo,9171
91
93
  mito_ai/file_uploads/urls.py,sha256=5U-Jx2GF7CsFIIsBNkvWBy_MU9pnk20G_BJGiAGENng,659
92
- mito_ai/log/handlers.py,sha256=RWkJFJ5OJ28Fm2AYgRbywxhgDZoTqjNwW-Z6tZJvUc4,1199
94
+ mito_ai/log/handlers.py,sha256=Zf300WzOWK2UAVaVzhr9xkCkw0QUexgX7xEtO2-u56o,1197
93
95
  mito_ai/log/urls.py,sha256=OLqAQObEDAwMVmzXZVftR2YBw5D9eCn0bDWlW_52DvI,657
94
96
  mito_ai/rules/handlers.py,sha256=dWnusYlQkKGyEEahNm9wtTYdIJq-lxVchyEvTd_Jkeg,1600
95
97
  mito_ai/rules/urls.py,sha256=HkhjOcfuKPN35crvY_CBABclOG8d18OfexcmQR-trFE,697
96
98
  mito_ai/rules/utils.py,sha256=7Hj5ZOUZERLHMR7a5_7ipbJXaiTkvXjfiRjTHpCKdxU,1664
99
+ mito_ai/settings/enterprise_handler.py,sha256=KAWEp0B-xvqiVWc4BfGDMK4TzxOXwMM14UktR8kTKyE,825
97
100
  mito_ai/settings/handlers.py,sha256=Ym1QieLf9VooP44w4mU2z4WtGSkThVhEgmtO7ENBg4c,1348
98
- mito_ai/settings/urls.py,sha256=4Oyd6Qtap2vMApyUevoUp_RjoL09IBIwPL6ZayGT3wM,648
101
+ mito_ai/settings/urls.py,sha256=gW7wQbQj5vQrXVMrS9oSFkBMyb2tlEYl5gZEIFgwHPA,802
99
102
  mito_ai/settings/utils.py,sha256=ZiG-axUDFsIKK7iipZTMwunYtP7_dkThHL37mR8GGyA,1355
100
- mito_ai/streamlit_conversion/agent_utils.py,sha256=3i2Fdfj9NVCvIv19BbJc0akCYHA8thkOFtN414tLFlM,1563
103
+ mito_ai/streamlit_conversion/agent_utils.py,sha256=MENz1M93w7kK96VzAMACT7GeX0xJULgfeUfM2sSU95Q,449
101
104
  mito_ai/streamlit_conversion/search_replace_utils.py,sha256=80tAohWalHemmDFbEtGcjFy-j-7u2-27c-pRooOxXWg,2955
102
- mito_ai/streamlit_conversion/streamlit_agent_handler.py,sha256=hqk_e7hC0BRraykIq6nANN1G1xmDDO0hZ-FoHaU5KMs,6973
105
+ mito_ai/streamlit_conversion/streamlit_agent_handler.py,sha256=aAfGGxFfOQDOOjgNhldlbrharT6Q8-z40APaLupoIKA,7601
103
106
  mito_ai/streamlit_conversion/streamlit_utils.py,sha256=4VpHmSoSWpOlwQn4All7mXywFuAn9OzeLfu_IK6vqX0,3002
104
107
  mito_ai/streamlit_conversion/validate_streamlit_app.py,sha256=l-mowqwylASGsM-vCtEzErGfp5ZnvhNaEh8VG0jtNec,3997
105
108
  mito_ai/streamlit_conversion/prompts/prompt_constants.py,sha256=N8ShlrqKViI92s3a20KmlOxNo12pSu0DgztmwHZu2Ys,4521
@@ -110,17 +113,19 @@ mito_ai/streamlit_conversion/prompts/streamlit_finish_todo_prompt.py,sha256=JU9q
110
113
  mito_ai/streamlit_conversion/prompts/streamlit_system_prompt.py,sha256=ksf3Erx5H-vkUmgbCdoWUHIc_3TI5yzsLb0sRKREwcA,3517
111
114
  mito_ai/streamlit_conversion/prompts/update_existing_app_prompt.py,sha256=e3t7qp2nNqlcHpEjBRPdVku1w2_X88m_IBkf_Yz--SA,2302
112
115
  mito_ai/streamlit_preview/__init__.py,sha256=RLNxLYp76fZ-nezx75oQB7BDnX4F81GH4ITMS4s5Rpo,196
113
- mito_ai/streamlit_preview/handlers.py,sha256=0yt3hRNGDPh5W3P3sh68MnWpJjolEr0adDRkD7HAoPk,5554
116
+ mito_ai/streamlit_preview/handlers.py,sha256=PvoWmXFZ44J4uVNqfhxmKe6ajv1d8FBf4VDOAhhC2v8,5704
114
117
  mito_ai/streamlit_preview/manager.py,sha256=Ey3Z7S9Bw576rrvshTC-CYDfOYJ0hKPhSL70foPtgTc,5451
115
- mito_ai/streamlit_preview/urls.py,sha256=IbcugX1H8u30Q6U8-9Ofdjmq_rdyAiesxw36qSB5giA,790
118
+ mito_ai/streamlit_preview/urls.py,sha256=EsQPQXwhfiQ_ihGlyAbG_l2OPuCeedmSQUw6aLUlaG8,979
116
119
  mito_ai/streamlit_preview/utils.py,sha256=_Ns-C0gdSAm7M3KAGCfMIf7tyumnU0qPYBB0eEUX1Aw,1212
117
120
  mito_ai/tests/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
118
121
  mito_ai/tests/conftest.py,sha256=C4iW3L50rWLeI91gim3gyyJnKKb1zGJ1GLxlXZWfLNs,1494
119
122
  mito_ai/tests/create_agent_system_message_prompt_test.py,sha256=PmNBCEz3vuy43CPRfE2JWgSVt1dfGFtn8pzBkDxBlyc,1061
120
- mito_ai/tests/open_ai_utils_test.py,sha256=LSJ6sIQq5xQ7RR3cYqBUegUagVQSoLemAbennCJMhiE,6646
123
+ mito_ai/tests/open_ai_utils_test.py,sha256=HQDUVy_m1FZWKl0zVNGjBh1LDKXIL7pyzezFHM4TFww,6372
121
124
  mito_ai/tests/performance_test.py,sha256=DwsvTTk51GZ1JOEMqvFHPGV6-8dfsL12GkEg9-7VlG8,12303
122
125
  mito_ai/tests/server_limits_test.py,sha256=BKIR75pUOntnQfmtif3XADHzcxzF9jMKEC4tqXefN-E,19521
123
- mito_ai/tests/test_constants.py,sha256=aBQRxuoNOax62gyGGHkk22CJZWhelmQnZXXdBLcY4go,1969
126
+ mito_ai/tests/test_constants.py,sha256=7GHhYMY52LNprqPttppDmaPqqHQGxXrJJ8bKiAwngMk,6620
127
+ mito_ai/tests/test_enterprise_mode.py,sha256=TjobAn5NQHqPWHuZhl-E3TCz1FdAcwLmiXahRq06IRQ,10315
128
+ mito_ai/tests/test_model_utils.py,sha256=cSnorppC8_ruQUTEyMiVU6TGSYU9Yv-et09vF7JQkMY,16569
124
129
  mito_ai/tests/test_telemetry.py,sha256=p5p0-7EQKIT0Lf_lNgE9wdU0bs0wv-tO9eQVI_hYACI,349
125
130
  mito_ai/tests/version_check_test.py,sha256=ffEme3mS0sn2u6UjN7uf6R7MfwMda8gVMWFuks2lEXE,6753
126
131
  mito_ai/tests/chat_history/test_chat_history.py,sha256=G6vluuusKXA8WXqIrIzEQdeRjDYN979r_Ox0KctwZK0,7586
@@ -142,21 +147,21 @@ mito_ai/tests/db/test_db_constants.py,sha256=ilzEo8BHeI3lBQjXLfrVb3hdH7_Gkg9_YWd
142
147
  mito_ai/tests/deploy_app/test_app_deploy_utils.py,sha256=s8cqxno0jShLwdTAjf0L-YsN6nxVjd-UUlZLDkMlaLI,3724
143
148
  mito_ai/tests/file_uploads/__init__.py,sha256=Oq613SdOIx0n9iCsVSp-4p4zzbdgjewk1_ggS09rt4Q,111
144
149
  mito_ai/tests/file_uploads/test_handlers.py,sha256=WqicGVFr5-cvSm0MSY7_p03E4lap0RJf6W0OpXjYne0,8832
145
- mito_ai/tests/message_history/test_generate_short_chat_name.py,sha256=0nwoJ9BNZLwwqUMCUe7EFfgpogbZ5djhpOr0kwkqfJM,4814
150
+ mito_ai/tests/message_history/test_generate_short_chat_name.py,sha256=0RnfAG_dcPwo9CF4PVKOOZxeJTekOP1jlNsgiKhFJqQ,10566
146
151
  mito_ai/tests/message_history/test_message_history_utils.py,sha256=6vp4GifG-h09oMFqmRgWXmIz1_eb_QfwSP_qBdFFUrQ,15229
147
- mito_ai/tests/providers/test_anthropic_client.py,sha256=R8orxW_o5uFx94BbtIXfiHG8PjwpNdHugp6sn3we-Jk,17504
148
- mito_ai/tests/providers/test_azure.py,sha256=6XJP7ZXmE6f41rEdimsAFgUF0I7bDB6jOKcu02sraak,27567
149
- mito_ai/tests/providers/test_capabilities.py,sha256=5pumT-CJeSzodxi9Wqt53SdudTmij5fapa6Zr3YMMbc,4621
150
- mito_ai/tests/providers/test_gemini_client.py,sha256=fhE06siTyluUlNyC3lJ2ffdkmG_1orCB5EU3mFsDOpg,7821
152
+ mito_ai/tests/providers/test_anthropic_client.py,sha256=DLuwE4c0erSjFfvKk8pdNFfD_Lh68Qa9whAJhvuwALE,24239
153
+ mito_ai/tests/providers/test_azure.py,sha256=02CcN6fXe-QVwqTom2mV6CnT5HYRfQ_6_lVxBCS_GJI,27602
154
+ mito_ai/tests/providers/test_capabilities.py,sha256=YLr7n6825VmtvZYpiT3mgg1qiVBcdUeKMgbSV_m_Oc4,4508
155
+ mito_ai/tests/providers/test_gemini_client.py,sha256=0Ndw-Aer4iWfAvzMkuDZkNtglJ-KYzkgkhBuVFXRO-c,7711
151
156
  mito_ai/tests/providers/test_mito_server_utils.py,sha256=34jjy-hUDwgav3g0CNe9ogCZwXXN7HdxgjRJKAad-_g,18885
152
- mito_ai/tests/providers/test_model_resolution.py,sha256=TXrdXD5qnJ1GnBqHZJR_6xCaTXTF1x-k0DE5QMQ09mk,6623
153
- mito_ai/tests/providers/test_openai_client.py,sha256=4f-B68JMZMIrvf_K7tEa8KDy-HyZ2Ov_ehqX7lzIWMc,2356
157
+ mito_ai/tests/providers/test_model_resolution.py,sha256=ZH_RzFZ7vYckgEMPF3QGzqmtt4oJRgz-_a6NAZy0Rag,9000
158
+ mito_ai/tests/providers/test_openai_client.py,sha256=vLf3YT0V5ipTG5rDaiCW2xx6yNVO0TbwQLbAo2zPY80,10603
154
159
  mito_ai/tests/providers/test_provider_completion_exception.py,sha256=BM09h8ZC7n1JGp9kqY4mE0xIJFBn7C6YcxAz6psyG5M,2645
155
- mito_ai/tests/providers/test_provider_limits.py,sha256=9GzNMV54pTTV1fzOtQci3cVQ0GwR6OI12hQYntyg-tI,1597
156
- mito_ai/tests/providers/test_providers.py,sha256=WEQRyNkGfyWE1sXJHxAsXyHaXKHRZIemVKE-DMNjjdk,14691
157
- mito_ai/tests/providers/test_retry_logic.py,sha256=8jizGx8A1R6ZYYAfH63LBdkry2xyT8NThfIH-xLx8-U,16081
160
+ mito_ai/tests/providers/test_provider_limits.py,sha256=leSPsIf8uUqNLRD1GqAHFsz9Nd3h-q-YQMl9n9GXhVw,1594
161
+ mito_ai/tests/providers/test_providers.py,sha256=1pAq8ELZssyRToaERd0_9zZSku5n3-pco3jYtOGqx5s,21859
162
+ mito_ai/tests/providers/test_retry_logic.py,sha256=aY9Z9tnZuPaqbDpw1CB5EBQXNk-6yceirxXSq3KvYXY,15732
158
163
  mito_ai/tests/providers/test_stream_mito_server_utils.py,sha256=SOOb1vU9U7xtiuIKYQaBIG-QYQqnsWXYVb9gTbTInz8,3930
159
- mito_ai/tests/providers/utils.py,sha256=z8lVfmXDHVzRpz4L6ZWEaHcY7uTUn_5FsmSr7UoxXtQ,3456
164
+ mito_ai/tests/providers/utils.py,sha256=lTlo4g49R0vIbZerV1JjjjV9hm57brZkYrKyrEEhg5o,3436
160
165
  mito_ai/tests/rules/conftest.py,sha256=DPW5JMtV5tZIKfDWq6R_DXTPJHZGMGfYsfA77cQi_ao,831
161
166
  mito_ai/tests/rules/rules_test.py,sha256=gaPGp3qMI-ZWW4J9nHEk9iXrAesB1mCyci7LDFN0K-g,3399
162
167
  mito_ai/tests/settings/conftest.py,sha256=dypIqQCssJ9sHArib7FTWQCrY2OLmkI3ZMK8Y3wtXDI,787
@@ -164,10 +169,10 @@ mito_ai/tests/settings/settings_test.py,sha256=dRmugyFeAfUZcvSLd9Bz2kQ96hnq0mrCv
164
169
  mito_ai/tests/settings/test_settings_constants.py,sha256=BBG7TCfl2pJzLcg825pRvEVgjP3D9sWyYAwqekQ10wo,349
165
170
  mito_ai/tests/streamlit_conversion/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
166
171
  mito_ai/tests/streamlit_conversion/test_apply_search_replace.py,sha256=PDyqApl79a8zjFHMDqrZn_2pKw1vyn1MTfbXt2bo_hA,5682
167
- mito_ai/tests/streamlit_conversion/test_streamlit_agent_handler.py,sha256=1WIadNoNSyGH9jdaXUpiumYlEiAydYl0JH47hd8DokI,11827
172
+ mito_ai/tests/streamlit_conversion/test_streamlit_agent_handler.py,sha256=J1xJiXSae0-doYwDmn5IdNHWFm_9wRDtj8xsZupO3n4,10788
168
173
  mito_ai/tests/streamlit_conversion/test_streamlit_utils.py,sha256=bZZQw3MwBsy1m5wPmjT0mpLb3hSewbMvj3W-hy_s1j0,7387
169
174
  mito_ai/tests/streamlit_conversion/test_validate_streamlit_app.py,sha256=a8vEAXZ6UDG_IZ9NR4qQURKabgs3XKcbc-f3PrOFbe0,3860
170
- mito_ai/tests/streamlit_preview/test_streamlit_preview_handler.py,sha256=LoGm85VfQV-UfG7gQ6HvNInCQp78TALxYLQPXo6Yyf8,5256
175
+ mito_ai/tests/streamlit_preview/test_streamlit_preview_handler.py,sha256=Xc13oKOsf0WG0zg-M3_dYqJGU5zFIzLRGvAse0RxGvk,5354
171
176
  mito_ai/tests/streamlit_preview/test_streamlit_preview_manager.py,sha256=0LueiqJj0lWkB8HRszXaT2UhZk-ZnardNkwMfZHDYQU,11655
172
177
  mito_ai/tests/user/__init__.py,sha256=Oq613SdOIx0n9iCsVSp-4p4zzbdgjewk1_ggS09rt4Q,111
173
178
  mito_ai/tests/user/test_user.py,sha256=5XA-lX2IYb9x_06sqAIJKTCnQqO1MytQxX7HDgcm3QU,3802
@@ -177,54 +182,56 @@ mito_ai/tests/utils/test_gemini_utils.py,sha256=DeN5392ZiuckeMw1agmHPaoa5y73TUSE
177
182
  mito_ai/user/handlers.py,sha256=wNDKWZZHzcl8SIFCmvR65HbU5NU5FBdfjBwzlBf000Y,1477
178
183
  mito_ai/user/urls.py,sha256=vUgE4r2QVbw275DvsRBjhJAOmiQ1pLG-F0JJcEJNZnE,626
179
184
  mito_ai/utils/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
180
- mito_ai/utils/anthropic_utils.py,sha256=HVf-OMw5xeneEdqIlQklX8yKQVsbn13ojrOPdqjx3f8,7293
185
+ mito_ai/utils/anthropic_utils.py,sha256=mY-BNU7SWpAdp_guXV_cqM_5WOi_XtwJjHbSq6uaesQ,7403
181
186
  mito_ai/utils/create.py,sha256=Awd_WOxUZgUveSPmAJJL1-csoIyqTV_00AIRCGIaCio,3086
182
187
  mito_ai/utils/db.py,sha256=oeNjFVg5JET1epjmUUs9uhgGzzvbCn3Na69UbVP0Ib4,2433
183
188
  mito_ai/utils/error_classes.py,sha256=n3UBUJepE4ETIH3ENi_pAXeYP0HyY6zQhEHRe91dRNU,1602
184
- mito_ai/utils/gemini_utils.py,sha256=zZlEeaQvqvndVxgNNmIQfB7OGkUd292bIlH0pvW0k4M,4643
189
+ mito_ai/utils/gemini_utils.py,sha256=ORpcVCl2bSg5lwZo-ee4WiQ2XhUl5AIpnE1elXDDiKw,4418
190
+ mito_ai/utils/litellm_utils.py,sha256=S1JBGAvWa_bTzkDP5acAy_4a82aoRjLF9u9WWIE4Tmc,3104
185
191
  mito_ai/utils/message_history_utils.py,sha256=C6eWYY_AQcpvPRlEmBjPGdrIJGORYU9nc4kk9qeCvIQ,4884
186
192
  mito_ai/utils/mito_server_utils.py,sha256=bjKCq8I7MS8_5nDdNV-UOfeh3kb4tI0YkyJ93T4U7lE,9367
187
- mito_ai/utils/open_ai_utils.py,sha256=uyzxXA_YDtC8IBP8PGvS6xEKbbs4jRmgKIbLTyYM2AU,6640
188
- mito_ai/utils/provider_utils.py,sha256=7kwA60AAsgtIeYIXO3QirRXqlWtC0kJqlkHJCTTG6iw,1763
193
+ mito_ai/utils/model_utils.py,sha256=N0Ny9DYRaS6qpwLweVFC9UnSxtL0fZaQPysh3CEJTb8,9540
194
+ mito_ai/utils/open_ai_utils.py,sha256=bqjHUZjMgqqPWrXlxUJ57SXykLHNi3Kwg9bhrQd_n0U,6476
195
+ mito_ai/utils/provider_utils.py,sha256=XZoxVycvFdZT65rRTnpcRou1nN2XstVMWR8EjG-s64Q,1103
189
196
  mito_ai/utils/schema.py,sha256=XAgw3GlAynGQDVIqWhKX_8trdlKuFVXatbUT-km_dhM,3106
190
197
  mito_ai/utils/server_limits.py,sha256=PAt1WpyaYRwV59UfHkt2IrGUJTF-NnE2PC143HxLJyA,6335
191
- mito_ai/utils/telemetry_utils.py,sha256=fsBoeGBLrCMMQ_l9AQ5G85KK8NhWB65BG3wTT86ZaRI,17121
198
+ mito_ai/utils/telemetry_utils.py,sha256=Ymg_juxGHd6OpH08PFmXYhs5Pvf9nvsQkOgR123ponU,17417
192
199
  mito_ai/utils/tokens.py,sha256=EZhBnjue4JelL_sMc8n59gIwiFa4Je7XFOSu6o1SkRA,1168
193
200
  mito_ai/utils/utils.py,sha256=Ygl84xLOh06GIoqvAW4D5ZfUO_ilSEPcpkLPL4bm3Bg,3224
194
201
  mito_ai/utils/version_utils.py,sha256=yT1OJZpH7Q1eABR2BfYNV09hJ6xXv_aFJI58ltfpnvk,2409
195
202
  mito_ai/utils/websocket_base.py,sha256=O4xjMHYUhxKN_lOKtVEGl3mW8EXkzdPWt1tUtsbiHgM,2941
196
- mito_ai-0.1.57.data/data/etc/jupyter/jupyter_server_config.d/mito_ai.json,sha256=jnrJTWHAtiNWoD0APwyPSP0v4oXBO9aAqGwzTCq7ij8,82
197
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/build_log.json,sha256=nQ05lg2F401-j-bsVB4IUuaBPFfan-E7vnbVlowFkho,24285
198
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/package.json,sha256=BQWoHYV1ZM4vNB1-eKp5PG6z2bz1GMq8zeYojd_aKYU,7342
199
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig,sha256=8oPTdzu9mGaLBvwOjhM2cVrdN31rGuicsfjYAe3dgIY,7200
200
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json,sha256=ec8DpF_QTgroq8BgLhmo1G2ByPPF-_tCnG3qRVq4qRE,894
201
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.9d26322f3e78beb2b666.js,sha256=leyZnDqn_Ofuuxn2oRCDZMGC6NOfcDkZSMD3vuYIJEY,1629334
202
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.9d26322f3e78beb2b666.js.map,sha256=GpCQo-jYbrjK1axn6L0eQrYdvzFdwXa2tfluxAU-yZ0,1666950
203
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js,sha256=5YLXH9YrEcyuTYXT9Ko_VJhj-CEJX9J2K9ILSlypLt8,5831
204
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map,sha256=mUU_J-LI5MzCUorOfESVGeaop5hs344g-agqSgEkTak,6760
205
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.79c1ea8a3cda73a4cb6f.js,sha256=TIrdv-vCRp5kNzwBNG0PYlLEekUPc0HpAfgNGRnqpd0,37928
206
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.79c1ea8a3cda73a4cb6f.js.map,sha256=g2XuaBv2cxH1FGQeTOGe6oeXBoA0rTRLgqy7W-UONzk,36639
207
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/style.js,sha256=ymGkha4YxU1j3e7KeoKfqYpcsPp1u3RRuHzMaiUnOhw,150
208
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js,sha256=I5Tbj3I3be-EAs9zsatymPNQMwvt-OkXztMu9poDrto,34327
209
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js.map,sha256=QGA8jQzVFE2hVOKLeyhFlcZ_CC6JkgntOGzXpDXMP3Y,29252
210
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js,sha256=yetgbLQTWpV9FiAdJhwM5jTWzAsTbqYhOckJCwDGwVw,33226
211
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js.map,sha256=E2rwLG1ARY-9kexmFn88i3ADA-cellPzEZfjZTWegEE,19070
212
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js,sha256=7qZt4qZgqoFq-T_fNAz0Z8cVPKQOHTCrcdOZFZazA8g,307327
213
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js.map,sha256=TdWZQcuq4PCOo6dtkZNsG3mfSfQP0HsnFh_3ANvGDNs,244867
214
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js,sha256=LTdWh-QP_Jfd7B1AD1ctH99ud2vuVy9a_F_Dj9qbLwc,57349
215
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map,sha256=dBmkthEcsYp8b1aZ-SHek5VkKnfR0gegHxpxNWmQshk,39713
216
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js,sha256=HFbycQUh9rIqkJ1lWyKcuk5F8OfiB9-Ah_lnxDUdOk8,2858564
217
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js.map,sha256=5pW1Y1B6SSe6wS4209P-_LQlWDtBS9QsTrhHSVaDm4Y,2274714
218
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js,sha256=TXjBjPWd-496FSCl0JcUYIFhxGHByLSu_Po_gb8CasU,743178
219
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js.map,sha256=h9TcYmXGZpSa8_1yKWK20mIn-mvrb4rIGPCaymnr8Mo,855442
220
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js,sha256=uYUAFa0GVVYcoVvYcw9cvNeF3OdZidQJVIrUE3UtRMQ,84610
221
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map,sha256=C0IxSaFYPj6nwxyvYGf9LLdBTFTKk93pPYEikFa1YQc,87246
222
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js,sha256=5gfmIE7bAaJYJZdTp5WuyTW6dKdU545i3X4LTSmiEcM,223110
223
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map,sha256=azV-DYUA9Yp99BcesR3Q0DzRIiD64xVRhE4lDbvK3Sg,245869
224
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.css,sha256=kDe4GLY_3mJu5AM_zaKZAb1zXMcB-lInLpz2OK4vbuQ,25660
225
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.js,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
226
- mito_ai-0.1.57.dist-info/METADATA,sha256=gdGCRPmWVL3ethNCEf17x5effXsBv-XYnsaesu08Q8o,7756
227
- mito_ai-0.1.57.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
228
- mito_ai-0.1.57.dist-info/entry_points.txt,sha256=OGsjpFBUq1QsuAlA3r2PeZXRwnnIWvzfgVhUqmx4qe4,79
229
- mito_ai-0.1.57.dist-info/licenses/LICENSE,sha256=O2F2Pp4Q1SmfzgYnl8krdrXZOaEo7Chjhk7OTYuGlDw,115
230
- mito_ai-0.1.57.dist-info/RECORD,,
203
+ mito_ai-0.1.59.data/data/etc/jupyter/jupyter_server_config.d/mito_ai.json,sha256=jnrJTWHAtiNWoD0APwyPSP0v4oXBO9aAqGwzTCq7ij8,82
204
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/build_log.json,sha256=_k_tr22MR58B08_--UspEugzoyCOZCOGSsEpiXwJcwc,24285
205
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/package.json,sha256=HeU6qXAuGa95slNbtLxeZhbmne2_0MWcLxU1wu9kB_c,7342
206
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig,sha256=vIGKv8KXtKpT678COclNlHlxGhTiiv-DE9pdf4Qvigo,7200
207
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json,sha256=ec8DpF_QTgroq8BgLhmo1G2ByPPF-_tCnG3qRVq4qRE,894
208
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.44c109c7be36fb884d25.js,sha256=a_OhcAOqy8Nz_w4e8gUUZK5oYhxG02fldBUB7lZ5SYo,1691341
209
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.44c109c7be36fb884d25.js.map,sha256=lYWmd0wSYzfAnR-MenQXnOkNFKM8ypnVg3oo1kKRc_M,1746362
210
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js,sha256=5YLXH9YrEcyuTYXT9Ko_VJhj-CEJX9J2K9ILSlypLt8,5831
211
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map,sha256=mUU_J-LI5MzCUorOfESVGeaop5hs344g-agqSgEkTak,6760
212
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.f7decebaf69618541e0f.js,sha256=3s0WyNASl6-rVmtd_-gyZ1inVvVN5C8eoAPHaV1JuaY,37928
213
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.f7decebaf69618541e0f.js.map,sha256=cwToi0-VeX56c0xvnV-_kp56u6hyJlx2GaGC8Bz2N7s,36639
214
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/style.js,sha256=ymGkha4YxU1j3e7KeoKfqYpcsPp1u3RRuHzMaiUnOhw,150
215
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js,sha256=I5Tbj3I3be-EAs9zsatymPNQMwvt-OkXztMu9poDrto,34327
216
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js.map,sha256=QGA8jQzVFE2hVOKLeyhFlcZ_CC6JkgntOGzXpDXMP3Y,29252
217
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js,sha256=yetgbLQTWpV9FiAdJhwM5jTWzAsTbqYhOckJCwDGwVw,33226
218
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js.map,sha256=E2rwLG1ARY-9kexmFn88i3ADA-cellPzEZfjZTWegEE,19070
219
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js,sha256=7qZt4qZgqoFq-T_fNAz0Z8cVPKQOHTCrcdOZFZazA8g,307327
220
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js.map,sha256=TdWZQcuq4PCOo6dtkZNsG3mfSfQP0HsnFh_3ANvGDNs,244867
221
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js,sha256=LTdWh-QP_Jfd7B1AD1ctH99ud2vuVy9a_F_Dj9qbLwc,57349
222
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map,sha256=dBmkthEcsYp8b1aZ-SHek5VkKnfR0gegHxpxNWmQshk,39713
223
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js,sha256=HFbycQUh9rIqkJ1lWyKcuk5F8OfiB9-Ah_lnxDUdOk8,2858564
224
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js.map,sha256=5pW1Y1B6SSe6wS4209P-_LQlWDtBS9QsTrhHSVaDm4Y,2274714
225
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js,sha256=TXjBjPWd-496FSCl0JcUYIFhxGHByLSu_Po_gb8CasU,743178
226
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js.map,sha256=h9TcYmXGZpSa8_1yKWK20mIn-mvrb4rIGPCaymnr8Mo,855442
227
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js,sha256=uYUAFa0GVVYcoVvYcw9cvNeF3OdZidQJVIrUE3UtRMQ,84610
228
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map,sha256=C0IxSaFYPj6nwxyvYGf9LLdBTFTKk93pPYEikFa1YQc,87246
229
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js,sha256=5gfmIE7bAaJYJZdTp5WuyTW6dKdU545i3X4LTSmiEcM,223110
230
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map,sha256=azV-DYUA9Yp99BcesR3Q0DzRIiD64xVRhE4lDbvK3Sg,245869
231
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.css,sha256=FsbUSRxu-Hb5pxE5GAg1ElnBsRSELMvlRJLgFtBgnAg,27500
232
+ mito_ai-0.1.59.data/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.js,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
233
+ mito_ai-0.1.59.dist-info/METADATA,sha256=yBF3xw899m5PZBrNAJASKvuZE0SVBmNFPontlSgg2rg,7779
234
+ mito_ai-0.1.59.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
235
+ mito_ai-0.1.59.dist-info/entry_points.txt,sha256=OGsjpFBUq1QsuAlA3r2PeZXRwnnIWvzfgVhUqmx4qe4,79
236
+ mito_ai-0.1.59.dist-info/licenses/LICENSE,sha256=O2F2Pp4Q1SmfzgYnl8krdrXZOaEo7Chjhk7OTYuGlDw,115
237
+ mito_ai-0.1.59.dist-info/RECORD,,
@@ -1,284 +0,0 @@
1
- # Copyright (c) Saga Inc.
2
- # Distributed under the terms of the GNU Affero General Public License v3.0 License.
3
-
4
- from __future__ import annotations
5
- import asyncio
6
- from typing import Any, Callable, Dict, List, Optional, Union, cast
7
- from mito_ai import constants
8
- from openai.types.chat import ChatCompletionMessageParam
9
- from traitlets import Instance, Unicode, default, validate
10
- from traitlets.config import LoggingConfigurable
11
- from openai.types.chat import ChatCompletionMessageParam
12
-
13
- from mito_ai import constants
14
- from mito_ai.enterprise.utils import is_azure_openai_configured
15
- from mito_ai.gemini_client import GeminiClient
16
- from mito_ai.openai_client import OpenAIClient
17
- from mito_ai.anthropic_client import AnthropicClient
18
- from mito_ai.logger import get_logger
19
- from mito_ai.completions.models import (
20
- AICapabilities,
21
- CompletionError,
22
- CompletionItem,
23
- CompletionItemError,
24
- CompletionReply,
25
- CompletionStreamChunk,
26
- MessageType,
27
- ResponseFormatInfo, CompletionItemError,
28
- )
29
- from mito_ai.utils.telemetry_utils import (
30
- KEY_TYPE_PARAM,
31
- MITO_AI_COMPLETION_ERROR,
32
- MITO_AI_COMPLETION_RETRY,
33
- MITO_SERVER_KEY,
34
- USER_KEY,
35
- log,
36
- log_ai_completion_error,
37
- log_ai_completion_retry,
38
- log_ai_completion_success,
39
- )
40
- from mito_ai.utils.provider_utils import get_model_provider
41
- from mito_ai.utils.mito_server_utils import ProviderCompletionException
42
-
43
- __all__ = ["OpenAIProvider"]
44
-
45
- class OpenAIProvider(LoggingConfigurable):
46
- """Provide AI feature through OpenAI services."""
47
-
48
- api_key = Unicode(
49
- config=True,
50
- allow_none=True,
51
- help="OpenAI API key. Default value is read from the OPENAI_API_KEY environment variable.",
52
- )
53
-
54
- last_error = Instance(
55
- CompletionError,
56
- allow_none=True,
57
- help="""Last error encountered when using the OpenAI provider.
58
-
59
- This attribute is observed by the websocket provider to push the error to the client.""",
60
- )
61
-
62
- def __init__(self, **kwargs: Dict[str, Any]) -> None:
63
- config = kwargs.get('config', {})
64
- if 'api_key' in kwargs:
65
- config['OpenAIClient'] = {'api_key': kwargs['api_key']}
66
- kwargs['config'] = config
67
-
68
- super().__init__(log=get_logger(), **kwargs)
69
- self.last_error = None
70
- self._openai_client: Optional[OpenAIClient] = OpenAIClient(**config)
71
-
72
- @property
73
- def capabilities(self) -> AICapabilities:
74
- """
75
- Returns the capabilities of the AI provider.
76
- """
77
- if constants.CLAUDE_API_KEY and not self.api_key:
78
- return AICapabilities(
79
- configuration={"model": "<dynamic>"},
80
- provider="Claude",
81
- )
82
- if constants.GEMINI_API_KEY and not self.api_key:
83
- return AICapabilities(
84
- configuration={"model": "<dynamic>"},
85
- provider="Gemini",
86
- )
87
- if self._openai_client:
88
- return self._openai_client.capabilities
89
-
90
- return AICapabilities(
91
- configuration={"model": "<dynamic>"},
92
- provider="Mito server",
93
- )
94
-
95
- @property
96
- def key_type(self) -> str:
97
- if constants.CLAUDE_API_KEY and not self.api_key:
98
- return "claude"
99
- if constants.GEMINI_API_KEY and not self.api_key:
100
- return "gemini"
101
- if self._openai_client:
102
- return self._openai_client.key_type
103
- return MITO_SERVER_KEY
104
-
105
- async def request_completions(
106
- self,
107
- message_type: MessageType,
108
- messages: List[ChatCompletionMessageParam],
109
- model: str,
110
- response_format_info: Optional[ResponseFormatInfo] = None,
111
- user_input: Optional[str] = None,
112
- thread_id: Optional[str] = None,
113
- max_retries: int = 3
114
- ) -> str:
115
- """
116
- Request completions from the AI provider.
117
- """
118
- self.last_error = None
119
- completion = None
120
- last_message_content = str(messages[-1].get('content', '')) if messages else ""
121
- model_type = get_model_provider(model)
122
-
123
- # Retry loop
124
- for attempt in range(max_retries + 1):
125
- try:
126
- if model_type == "claude":
127
- api_key = constants.CLAUDE_API_KEY
128
- anthropic_client = AnthropicClient(api_key=api_key)
129
- completion = await anthropic_client.request_completions(messages, model, response_format_info, message_type)
130
- elif model_type == "gemini":
131
- api_key = constants.GEMINI_API_KEY
132
- gemini_client = GeminiClient(api_key=api_key)
133
- messages_for_gemini = [dict(m) for m in messages]
134
- completion = await gemini_client.request_completions(messages_for_gemini, model, response_format_info, message_type)
135
- elif model_type == "openai":
136
- if not self._openai_client:
137
- raise RuntimeError("OpenAI client is not initialized.")
138
- completion = await self._openai_client.request_completions(
139
- message_type=message_type,
140
- messages=messages,
141
- model=model,
142
- response_format_info=response_format_info
143
- )
144
- else:
145
- raise ValueError(f"No AI provider configured for model: {model}")
146
-
147
- # Success! Log and return
148
- log_ai_completion_success(
149
- key_type=USER_KEY if self.key_type == "user" else MITO_SERVER_KEY,
150
- message_type=message_type,
151
- last_message_content=last_message_content,
152
- response={"completion": completion},
153
- user_input=user_input or "",
154
- thread_id=thread_id or "",
155
- model=model
156
- )
157
- return completion # type: ignore
158
-
159
- except PermissionError as e:
160
- # If we hit a free tier limit, then raise an exception right away without retrying.
161
- self.log.exception(f"Error during request_completions: {e}")
162
- self.last_error = CompletionError.from_exception(e)
163
- log_ai_completion_error('user_key' if self.key_type != MITO_SERVER_KEY else 'mito_server_key', thread_id or "", message_type, e)
164
- raise
165
-
166
- except BaseException as e:
167
- # Check if we should retry (not on the last attempt)
168
- if attempt < max_retries:
169
- # Exponential backoff: wait 2^attempt seconds
170
- wait_time = 2 ** attempt
171
- self.log.info(f"Retrying request_completions after {wait_time}s (attempt {attempt + 1}/{max_retries + 1}): {str(e)}")
172
- log_ai_completion_retry('user_key' if self.key_type != MITO_SERVER_KEY else 'mito_server_key', thread_id or "", message_type, e)
173
- await asyncio.sleep(wait_time)
174
- continue
175
- else:
176
- # Final failure after all retries - set error state and raise
177
- self.log.exception(f"Error during request_completions after {attempt + 1} attempts: {e}")
178
- self.last_error = CompletionError.from_exception(e)
179
- log_ai_completion_error('user_key' if self.key_type != MITO_SERVER_KEY else 'mito_server_key', thread_id or "", message_type, e)
180
- raise
181
-
182
- # This should never be reached due to the raise in the except block,
183
- # but added to satisfy the linter
184
- raise RuntimeError("Unexpected code path in request_completions")
185
-
186
- async def stream_completions(
187
- self,
188
- message_type: MessageType,
189
- messages: List[ChatCompletionMessageParam],
190
- model: str,
191
- message_id: str,
192
- thread_id: str,
193
- reply_fn: Callable[[Union[CompletionReply, CompletionStreamChunk]], None],
194
- user_input: Optional[str] = None,
195
- response_format_info: Optional[ResponseFormatInfo] = None
196
- ) -> str:
197
- """
198
- Stream completions from the AI provider and return the accumulated response.
199
- Returns: The accumulated response string.
200
- """
201
- self.last_error = None
202
- accumulated_response = ""
203
- last_message_content = str(messages[-1].get('content', '')) if messages else ""
204
- model_type = get_model_provider(model)
205
- reply_fn(CompletionReply(
206
- items=[
207
- CompletionItem(content="", isIncomplete=True, token=message_id)
208
- ],
209
- parent_id=message_id,
210
- ))
211
-
212
- try:
213
- if model_type == "claude":
214
- api_key = constants.CLAUDE_API_KEY
215
- anthropic_client = AnthropicClient(api_key=api_key)
216
- accumulated_response = await anthropic_client.stream_completions(
217
- messages=messages,
218
- model=model,
219
- message_type=message_type,
220
- message_id=message_id,
221
- reply_fn=reply_fn
222
- )
223
- elif model_type == "gemini":
224
- api_key = constants.GEMINI_API_KEY
225
- gemini_client = GeminiClient(api_key=api_key)
226
- # TODO: We shouldn't need to do this because the messages should already be dictionaries...
227
- # but if we do have to do some pre-processing, we should do it in the gemini_client instead.
228
- messages_for_gemini = [dict(m) for m in messages]
229
- accumulated_response = await gemini_client.stream_completions(
230
- messages=messages_for_gemini,
231
- model=model,
232
- message_id=message_id,
233
- reply_fn=reply_fn,
234
- message_type=message_type
235
- )
236
- elif model_type == "openai":
237
- if not self._openai_client:
238
- raise RuntimeError("OpenAI client is not initialized.")
239
- accumulated_response = await self._openai_client.stream_completions(
240
- message_type=message_type,
241
- messages=messages,
242
- model=model,
243
- message_id=message_id,
244
- thread_id=thread_id,
245
- reply_fn=reply_fn,
246
- user_input=user_input,
247
- response_format_info=response_format_info
248
- )
249
- else:
250
- raise ValueError(f"No AI provider configured for model: {model}")
251
-
252
- # Log the successful completion
253
- log_ai_completion_success(
254
- key_type=USER_KEY if self.key_type == "user" else MITO_SERVER_KEY,
255
- message_type=message_type,
256
- last_message_content=last_message_content,
257
- response={"completion": accumulated_response},
258
- user_input=user_input or "",
259
- thread_id=thread_id,
260
- model=model
261
- )
262
- return accumulated_response
263
-
264
- except BaseException as e:
265
- self.log.exception(f"Error during stream_completions: {e}")
266
- self.last_error = CompletionError.from_exception(e)
267
- log_ai_completion_error('user_key' if self.key_type != MITO_SERVER_KEY else 'mito_server_key', thread_id, message_type, e)
268
-
269
- # Send error message to client before raising
270
- reply_fn(CompletionStreamChunk(
271
- parent_id=message_id,
272
- chunk=CompletionItem(
273
- content="",
274
- isIncomplete=True,
275
- error=CompletionItemError(
276
- message=f"Failed to process completion: {e!r}"
277
- ),
278
- token=message_id,
279
- ),
280
- done=True,
281
- error=CompletionError.from_exception(e),
282
- ))
283
- raise
284
-