mito-ai 0.1.54__py3-none-any.whl → 0.1.56__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 (73) hide show
  1. mito_ai/_version.py +1 -1
  2. mito_ai/anthropic_client.py +7 -6
  3. mito_ai/completions/models.py +1 -1
  4. mito_ai/completions/prompt_builders/agent_execution_prompt.py +18 -50
  5. mito_ai/completions/prompt_builders/agent_smart_debug_prompt.py +77 -92
  6. mito_ai/completions/prompt_builders/agent_system_message.py +216 -270
  7. mito_ai/completions/prompt_builders/chat_prompt.py +15 -100
  8. mito_ai/completions/prompt_builders/chat_system_message.py +102 -63
  9. mito_ai/completions/prompt_builders/explain_code_prompt.py +22 -24
  10. mito_ai/completions/prompt_builders/inline_completer_prompt.py +78 -107
  11. mito_ai/completions/prompt_builders/prompt_constants.py +20 -36
  12. mito_ai/completions/prompt_builders/prompt_section_registry/__init__.py +70 -0
  13. mito_ai/completions/prompt_builders/prompt_section_registry/active_cell_code.py +15 -0
  14. mito_ai/completions/prompt_builders/prompt_section_registry/active_cell_id.py +10 -0
  15. mito_ai/completions/prompt_builders/prompt_section_registry/active_cell_output.py +20 -0
  16. mito_ai/completions/prompt_builders/prompt_section_registry/base.py +37 -0
  17. mito_ai/completions/prompt_builders/prompt_section_registry/error_traceback.py +17 -0
  18. mito_ai/completions/prompt_builders/prompt_section_registry/example.py +19 -0
  19. mito_ai/completions/prompt_builders/prompt_section_registry/files.py +17 -0
  20. mito_ai/completions/prompt_builders/prompt_section_registry/generic.py +15 -0
  21. mito_ai/completions/prompt_builders/prompt_section_registry/get_cell_output_tool_response.py +21 -0
  22. mito_ai/completions/prompt_builders/prompt_section_registry/notebook.py +19 -0
  23. mito_ai/completions/prompt_builders/prompt_section_registry/rules.py +39 -0
  24. mito_ai/completions/prompt_builders/prompt_section_registry/selected_context.py +100 -0
  25. mito_ai/completions/prompt_builders/prompt_section_registry/streamlit_app_status.py +25 -0
  26. mito_ai/completions/prompt_builders/prompt_section_registry/task.py +12 -0
  27. mito_ai/completions/prompt_builders/prompt_section_registry/variables.py +18 -0
  28. mito_ai/completions/prompt_builders/smart_debug_prompt.py +48 -63
  29. mito_ai/constants.py +0 -3
  30. mito_ai/tests/completions/test_prompt_section_registry.py +44 -0
  31. mito_ai/tests/message_history/test_message_history_utils.py +273 -340
  32. mito_ai/tests/providers/test_anthropic_client.py +7 -3
  33. mito_ai/utils/message_history_utils.py +68 -44
  34. mito_ai/utils/open_ai_utils.py +3 -0
  35. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +147 -102
  36. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/package.json +3 -2
  37. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +3 -2
  38. mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.31462f8f6a76b1cefbeb.js → mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.dfd7975de75d64db80d6.js +2689 -472
  39. mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.dfd7975de75d64db80d6.js.map +1 -0
  40. mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.3f3c98eaba66bf084c66.js → mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.1e7b5cf362385f109883.js +21 -19
  41. mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.1e7b5cf362385f109883.js.map +1 -0
  42. mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js → mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js +15 -7
  43. mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js.map +1 -0
  44. mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.css +708 -0
  45. mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.js +0 -0
  46. {mito_ai-0.1.54.dist-info → mito_ai-0.1.56.dist-info}/METADATA +5 -1
  47. {mito_ai-0.1.54.dist-info → mito_ai-0.1.56.dist-info}/RECORD +69 -51
  48. mito_ai/completions/prompt_builders/utils.py +0 -84
  49. mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.31462f8f6a76b1cefbeb.js.map +0 -1
  50. mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.3f3c98eaba66bf084c66.js.map +0 -1
  51. mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js.map +0 -1
  52. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
  53. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
  54. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js +0 -0
  55. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map +0 -0
  56. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
  57. {mito_ai-0.1.54.data → mito_ai-0.1.56.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
  58. {mito_ai-0.1.54.data → mito_ai-0.1.56.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
  59. {mito_ai-0.1.54.data → mito_ai-0.1.56.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
  60. {mito_ai-0.1.54.data → mito_ai-0.1.56.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
  61. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js +0 -0
  62. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map +0 -0
  63. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js +0 -0
  64. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js.map +0 -0
  65. {mito_ai-0.1.54.data → mito_ai-0.1.56.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
  66. {mito_ai-0.1.54.data → mito_ai-0.1.56.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
  67. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js +0 -0
  68. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map +0 -0
  69. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
  70. {mito_ai-0.1.54.data → mito_ai-0.1.56.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
  71. {mito_ai-0.1.54.dist-info → mito_ai-0.1.56.dist-info}/WHEEL +0 -0
  72. {mito_ai-0.1.54.dist-info → mito_ai-0.1.56.dist-info}/entry_points.txt +0 -0
  73. {mito_ai-0.1.54.dist-info → mito_ai-0.1.56.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mito_ai
3
- Version: 0.1.54
3
+ Version: 0.1.56
4
4
  Summary: AI chat for JupyterLab
5
5
  Project-URL: Homepage, https://trymito.io
6
6
  Project-URL: Bug Tracker, https://github.com/mito-ds/monorepo/issues
@@ -132,6 +132,10 @@ jupyter labextension develop . --overwrite
132
132
  # Start the jupyter server extension for development
133
133
  jupyter server extension enable --py mito_ai
134
134
 
135
+ # (Optional) Setup fixed Jupyter token for Cursor agent testing
136
+ # This creates a development-only config that allows Cursor to automatically test changes
137
+ python dev/setup_jupyter_dev_token.py
138
+
135
139
  # Watch the source directory in one terminal, automatically rebuilding when needed
136
140
  # In case of Error: If this command fails because the lib directory was not created (the error will say something like
137
141
  # unable to find main entry point) then run `jlpm run clean:lib` first to get rid of the old buildcache
@@ -1,7 +1,7 @@
1
1
  mito_ai/__init__.py,sha256=oPEfw-SkL6QAmF_XBGTBWMYMS2LFizdvCwkHDJZ8WQs,4880
2
- mito_ai/_version.py,sha256=A8H6ye41dl8d4pvDtMKor9WLuCenGAZkJ0l2g0BCnjg,172
3
- mito_ai/anthropic_client.py,sha256=U5zDyFP15aifDGPgPnrIx9J3fitwPbqY43h_LqrBenY,14092
4
- mito_ai/constants.py,sha256=2TI9rEpsOkdSpjZ4PELo0PefMfKGtk9rkDsu0gXV-j4,2301
2
+ mito_ai/_version.py,sha256=fqbEFk3uRC8hyizZUCaqulfRMEnW4R9dQ0ldzdFVjHI,172
3
+ mito_ai/anthropic_client.py,sha256=f5O7lnQ3fC6LiRg4qT25SsGgcRCuO6fLXXicXFQ3iRY,14144
4
+ mito_ai/constants.py,sha256=wP-J-srUgX2j8sbQ4nbFapalCrGZTX_k4u78ojYSHHY,2260
5
5
  mito_ai/gemini_client.py,sha256=4L-h2yYc_p8cEOCMDYM0R-vD4aktfqN47siZH5ZjGJc,9771
6
6
  mito_ai/logger.py,sha256=ZJEC415ZHTodDYKgp8ezVg3c4O513oQZV5lSs708gp8,1285
7
7
  mito_ai/openai_client.py,sha256=ljLs-HmHX5IElVn-5GuLTLijVPzWKCzg0uA263K57Dw,14210
@@ -23,7 +23,7 @@ mito_ai/chat_history/handlers.py,sha256=zRH9oNiwf_x7bYaa0JPoodoMuWwcFzEvg9svAAzZ
23
23
  mito_ai/chat_history/urls.py,sha256=WoXVkS3tn_wohT_6tQ5iLVF26llL697vmgkMb7xsvT0,1100
24
24
  mito_ai/completions/handlers.py,sha256=BpfBke-IddQfaje0UYMFiCNcehXzVgC86zwqS4P2HBw,17724
25
25
  mito_ai/completions/message_history.py,sha256=e-PZZd7fU2iQSH18tDsTb7J_QC56K29ZIIwivMQaVqk,17213
26
- mito_ai/completions/models.py,sha256=bfVosjHyXdXp7VxB2KzESLVCoeX3kwtkxqHs9yoQsPE,10340
26
+ mito_ai/completions/models.py,sha256=LZ29jUzAM1c4cp9ARggJKHJulNDChf84j_MM8n7TgPI,10348
27
27
  mito_ai/completions/providers.py,sha256=JcZZGxFDd5B2nwnwOuJICMhjLRpLFL8_QhomaepXb5c,11950
28
28
  mito_ai/completions/completion_handlers/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
29
29
  mito_ai/completions/completion_handlers/agent_auto_error_fixup_handler.py,sha256=Vu-SoOziFnWQjxomTpbnbZgxtLkvqPS4Etw2me6L94M,2810
@@ -35,17 +35,32 @@ mito_ai/completions/completion_handlers/inline_completer_handler.py,sha256=IR9xP
35
35
  mito_ai/completions/completion_handlers/smart_debug_handler.py,sha256=5DH4NR9YB28YoQOUbFFcF7bip11cFzmzrcap_bZGLwA,6388
36
36
  mito_ai/completions/completion_handlers/utils.py,sha256=Bk-EX9gj_riRQrBC5Bjp5ceFbgymgBDmNXa1SZ9Vt1M,4389
37
37
  mito_ai/completions/prompt_builders/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
38
- mito_ai/completions/prompt_builders/agent_execution_prompt.py,sha256=ffnkgZ-1_hvs1wDWDwY4_PzyqPN_hmRHR2CNbqfQxYI,1697
39
- mito_ai/completions/prompt_builders/agent_smart_debug_prompt.py,sha256=hMeGBBXs6TItkZHpI78uN2scKvV72uha3Pw-ygN4XbI,6903
40
- mito_ai/completions/prompt_builders/agent_system_message.py,sha256=v1lsOjUbe7_y-TRSej1iX0iTwtpHBoioBlVAFkUZNjg,28678
38
+ mito_ai/completions/prompt_builders/agent_execution_prompt.py,sha256=onj6u6s6bF5XdN_2lSOnYyMIaype8Pk_d3HLHTZv0-U,1034
39
+ mito_ai/completions/prompt_builders/agent_smart_debug_prompt.py,sha256=BGwoxHKlNH-4avoGA0DkNaIFIZbZASLGixz46g6t_mo,7129
40
+ mito_ai/completions/prompt_builders/agent_system_message.py,sha256=rbsKBlG2AQXkjMqs9NpviF0NJFkGgxDKLT910T5YZ4U,29963
41
41
  mito_ai/completions/prompt_builders/chat_name_prompt.py,sha256=ERwgDUAnd7VH3drjbUh70zbP3iEUct1PdJ9EZvMi3qE,532
42
- mito_ai/completions/prompt_builders/chat_prompt.py,sha256=v2Ril9xUxhgPHixtckMBNiOyOn7y110npQgY285pPSc,2941
43
- mito_ai/completions/prompt_builders/chat_system_message.py,sha256=LTMRSHKaO_AqvIiIiV1wz4As9gzcFH57VJoTR2EI0uc,4588
44
- mito_ai/completions/prompt_builders/explain_code_prompt.py,sha256=aswSXdZP-catLmLqJKv2E5VeO9CL7vexguZhtGl724c,769
45
- mito_ai/completions/prompt_builders/inline_completer_prompt.py,sha256=rmOt3eZTgNfF5tN-_syrhIUW6Ga_TcHCRI0YwndYPPY,5105
46
- mito_ai/completions/prompt_builders/prompt_constants.py,sha256=_iwWD6xJ641Tzi-6xlSCTLdLr2_a9RQu_pZGmq95r3U,7935
47
- mito_ai/completions/prompt_builders/smart_debug_prompt.py,sha256=6s_VIgNCD5Dqmn3bpsnQCmUDaqJqLOxlJHu48aE1SME,6347
48
- mito_ai/completions/prompt_builders/utils.py,sha256=AqIij4Ceg9I7DeUZ7oV49jPXvNIESh7fpyO_XAdeYN0,3182
42
+ mito_ai/completions/prompt_builders/chat_prompt.py,sha256=ozgbzjXaiXLFcmctu07Wmj1ZhK-7u9WV1-_fqyGV8Ww,1143
43
+ mito_ai/completions/prompt_builders/chat_system_message.py,sha256=jSy1loc50lKrVQkY-mym28RtDE8Z7lXYJ_xffi6l7sw,7677
44
+ mito_ai/completions/prompt_builders/explain_code_prompt.py,sha256=jN5bX4TqdE0YbcaHxBQOFqryTiv_Gl-m8gNZN7Bju-Q,1178
45
+ mito_ai/completions/prompt_builders/inline_completer_prompt.py,sha256=9j8tOn3wIxVTYyje-oadPidHtdrXdXY8Q89kN-nFXu8,5082
46
+ mito_ai/completions/prompt_builders/prompt_constants.py,sha256=8C2xGUKmevphiqapFoPth9fX7rsjaSh0eDLknHcX9dU,8423
47
+ mito_ai/completions/prompt_builders/smart_debug_prompt.py,sha256=2FdH_BAlXOMozbLRHN3q_fkcdhHRwGK7tTKpR1Xu98Y,6676
48
+ mito_ai/completions/prompt_builders/prompt_section_registry/__init__.py,sha256=laS2z7BwYCQXeBzqXZEbbb1w8MOm7Rgko5yWUwNlW9A,2598
49
+ mito_ai/completions/prompt_builders/prompt_section_registry/active_cell_code.py,sha256=ZgRI91XLLE3naj8M-wlV7qcl5l1rGhCLGnhW8vVqm5Q,427
50
+ mito_ai/completions/prompt_builders/prompt_section_registry/active_cell_id.py,sha256=T2AuF0C1d7osyS9xUDxKIlvIkRvfoTAae384CfyMCTA,274
51
+ mito_ai/completions/prompt_builders/prompt_section_registry/active_cell_output.py,sha256=FCqOUYPgLTdUe1gmk6mA_ep6j-fdJapqtU0khMXSEes,719
52
+ mito_ai/completions/prompt_builders/prompt_section_registry/base.py,sha256=kT_wVrE27J9zhhpYBvXSbj_K5UW1MPkYGHkVIAE2IO4,1317
53
+ mito_ai/completions/prompt_builders/prompt_section_registry/error_traceback.py,sha256=K4ja0nB-R5OuWfd5GptfcIGLX8tAROuO9m9LCJzYcjY,553
54
+ mito_ai/completions/prompt_builders/prompt_section_registry/example.py,sha256=uehjSKDW9wB9rVnMrXDcJi-O45vVKW9f0xsSeW-4bHg,724
55
+ mito_ai/completions/prompt_builders/prompt_section_registry/files.py,sha256=K9g4ra66F9A0jWOlZLS61hj2ks2auSrOjQK6oIzSgE8,530
56
+ mito_ai/completions/prompt_builders/prompt_section_registry/generic.py,sha256=v6qNA2M5YcgOTbj9lnIBQcswmSnVeVcEbl3T2pRTU5w,443
57
+ mito_ai/completions/prompt_builders/prompt_section_registry/get_cell_output_tool_response.py,sha256=EM564BVAzv0_cDYx6MJQIP49CpbLO9wYR_uxFQb-0ZE,861
58
+ mito_ai/completions/prompt_builders/prompt_section_registry/notebook.py,sha256=69MjY7laITXo0oA8l5oI65OhRS5YqF5YEskxeAFUuVE,568
59
+ mito_ai/completions/prompt_builders/prompt_section_registry/rules.py,sha256=ko0UdPwUnsz0B5YJOr0_sHso0hMP-qC9y0m694QhIEI,1265
60
+ mito_ai/completions/prompt_builders/prompt_section_registry/selected_context.py,sha256=HTMrzoF9-ORAdsAsctH_DSEqbH-hoGG1_VmD-KwyjRs,4213
61
+ mito_ai/completions/prompt_builders/prompt_section_registry/streamlit_app_status.py,sha256=J2D9rUYgIx7vfvJ7XF-zCDplcyTjUhk4zWpuosSBQlw,1042
62
+ mito_ai/completions/prompt_builders/prompt_section_registry/task.py,sha256=30lYt0wFarE4NrrooR1E5xRNZfp4s410D6-T7LS-oCY,339
63
+ mito_ai/completions/prompt_builders/prompt_section_registry/variables.py,sha256=TCGl9mQQMGakjIe_46tQHHSZhX-S39jtbgUxS-U4TPE,540
49
64
  mito_ai/db/__init__.py,sha256=10bPaPwGgcrId4d0uHyFr6ExhhbjO9Dog2oAfPHSMPs,112
50
65
  mito_ai/db/handlers.py,sha256=zbLqgzexi3C2ztvT1z9X3RLCUUjl4r5rJtUzJX0Pkto,5275
51
66
  mito_ai/db/models.py,sha256=KUMaAdK72Z_yOovKrrQJWHP-5Zwkv9WD4Pz8LDWjgk8,544
@@ -104,6 +119,7 @@ mito_ai/tests/test_telemetry.py,sha256=p5p0-7EQKIT0Lf_lNgE9wdU0bs0wv-tO9eQVI_hYA
104
119
  mito_ai/tests/version_check_test.py,sha256=ffEme3mS0sn2u6UjN7uf6R7MfwMda8gVMWFuks2lEXE,6753
105
120
  mito_ai/tests/chat_history/test_chat_history.py,sha256=G6vluuusKXA8WXqIrIzEQdeRjDYN979r_Ox0KctwZK0,7586
106
121
  mito_ai/tests/completions/completion_handlers_utils_test.py,sha256=8IDFrbf0b9BJ6wLr-F0hyhxeruKI9Vyr1KaTMwOhS1Q,7433
122
+ mito_ai/tests/completions/test_prompt_section_registry.py,sha256=ppOzTaj1nKSoV6OsaWCjgPjaNjdaX-t4S_VemSD7MWM,1604
107
123
  mito_ai/tests/data/prompt_lg.py,sha256=8Bu_S73P6Ot7LoTC8Xet6pVq7FwoDH9WeJpc5zuPwos,2456
108
124
  mito_ai/tests/data/prompt_sm.py,sha256=JJJoMnqkIVmeQGP8auOzJ06br-KDNIHN-ES86G9K2sc,239
109
125
  mito_ai/tests/data/prompt_xl.py,sha256=zlVV-K9ZUkg5QG3bRDCdLJkpkjInO2Q2hEwAMIo5tpY,16399
@@ -121,8 +137,8 @@ mito_ai/tests/deploy_app/test_app_deploy_utils.py,sha256=s8cqxno0jShLwdTAjf0L-Ys
121
137
  mito_ai/tests/file_uploads/__init__.py,sha256=Oq613SdOIx0n9iCsVSp-4p4zzbdgjewk1_ggS09rt4Q,111
122
138
  mito_ai/tests/file_uploads/test_handlers.py,sha256=WqicGVFr5-cvSm0MSY7_p03E4lap0RJf6W0OpXjYne0,8832
123
139
  mito_ai/tests/message_history/test_generate_short_chat_name.py,sha256=0nwoJ9BNZLwwqUMCUe7EFfgpogbZ5djhpOr0kwkqfJM,4814
124
- mito_ai/tests/message_history/test_message_history_utils.py,sha256=HdHZh1yRWYMm8TIFDw06HT-wMPrYa45COn_DFZWR-eg,17925
125
- mito_ai/tests/providers/test_anthropic_client.py,sha256=0Tkmqx-rXunXvkFmB0eqTRW6mFtODGObjWM5hf0Kh2w,17253
140
+ mito_ai/tests/message_history/test_message_history_utils.py,sha256=6vp4GifG-h09oMFqmRgWXmIz1_eb_QfwSP_qBdFFUrQ,15229
141
+ mito_ai/tests/providers/test_anthropic_client.py,sha256=R8orxW_o5uFx94BbtIXfiHG8PjwpNdHugp6sn3we-Jk,17504
126
142
  mito_ai/tests/providers/test_azure.py,sha256=6XJP7ZXmE6f41rEdimsAFgUF0I7bDB6jOKcu02sraak,27567
127
143
  mito_ai/tests/providers/test_capabilities.py,sha256=5pumT-CJeSzodxi9Wqt53SdudTmij5fapa6Zr3YMMbc,4621
128
144
  mito_ai/tests/providers/test_gemini_client.py,sha256=fhE06siTyluUlNyC3lJ2ffdkmG_1orCB5EU3mFsDOpg,7821
@@ -160,9 +176,9 @@ mito_ai/utils/create.py,sha256=Awd_WOxUZgUveSPmAJJL1-csoIyqTV_00AIRCGIaCio,3086
160
176
  mito_ai/utils/db.py,sha256=oeNjFVg5JET1epjmUUs9uhgGzzvbCn3Na69UbVP0Ib4,2433
161
177
  mito_ai/utils/error_classes.py,sha256=n3UBUJepE4ETIH3ENi_pAXeYP0HyY6zQhEHRe91dRNU,1602
162
178
  mito_ai/utils/gemini_utils.py,sha256=zZlEeaQvqvndVxgNNmIQfB7OGkUd292bIlH0pvW0k4M,4643
163
- mito_ai/utils/message_history_utils.py,sha256=a2GjYzK3pRLiNwXxTqdxKfWKELTg40AJTJXY7vUubgY,3278
179
+ mito_ai/utils/message_history_utils.py,sha256=C6eWYY_AQcpvPRlEmBjPGdrIJGORYU9nc4kk9qeCvIQ,4884
164
180
  mito_ai/utils/mito_server_utils.py,sha256=bjKCq8I7MS8_5nDdNV-UOfeh3kb4tI0YkyJ93T4U7lE,9367
165
- mito_ai/utils/open_ai_utils.py,sha256=1mCVIzzW-fIuEIEhowtvCPCrvu5nn5Hxlei64fseocI,6549
181
+ mito_ai/utils/open_ai_utils.py,sha256=uyzxXA_YDtC8IBP8PGvS6xEKbbs4jRmgKIbLTyYM2AU,6640
166
182
  mito_ai/utils/provider_utils.py,sha256=vVoo1lQc83Jnm0dgYf5L9AxfiWrb5HVb5Lno_vDQQyk,1671
167
183
  mito_ai/utils/schema.py,sha256=XAgw3GlAynGQDVIqWhKX_8trdlKuFVXatbUT-km_dhM,3106
168
184
  mito_ai/utils/server_limits.py,sha256=PAt1WpyaYRwV59UfHkt2IrGUJTF-NnE2PC143HxLJyA,6335
@@ -171,36 +187,38 @@ mito_ai/utils/tokens.py,sha256=EZhBnjue4JelL_sMc8n59gIwiFa4Je7XFOSu6o1SkRA,1168
171
187
  mito_ai/utils/utils.py,sha256=Ygl84xLOh06GIoqvAW4D5ZfUO_ilSEPcpkLPL4bm3Bg,3224
172
188
  mito_ai/utils/version_utils.py,sha256=yT1OJZpH7Q1eABR2BfYNV09hJ6xXv_aFJI58ltfpnvk,2409
173
189
  mito_ai/utils/websocket_base.py,sha256=O4xjMHYUhxKN_lOKtVEGl3mW8EXkzdPWt1tUtsbiHgM,2941
174
- mito_ai-0.1.54.data/data/etc/jupyter/jupyter_server_config.d/mito_ai.json,sha256=jnrJTWHAtiNWoD0APwyPSP0v4oXBO9aAqGwzTCq7ij8,82
175
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/build_log.json,sha256=bmTCy3Bjx-GSsV4uECwh8FoUndo0YjtIQr1RfMRs1AU,23099
176
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/package.json,sha256=ptpOlf7tctFWfk-jV7vxKvfNVM_Gd_1Z84UM4eyS18g,7300
177
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig,sha256=QDpQVmJggJUsh8NmDi_TeWV18f0Dq8KSdmBXp03Cngo,7158
178
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json,sha256=ec8DpF_QTgroq8BgLhmo1G2ByPPF-_tCnG3qRVq4qRE,894
179
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.31462f8f6a76b1cefbeb.js,sha256=iSzcRtRDG6Twk03UM-iayBbWHbLdeM0yKoNSpGME4G8,1377949
180
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.31462f8f6a76b1cefbeb.js.map,sha256=-6yxfzJzzUMNcQbIwDInCgS1dCxgI-Tmts4jxsjWxUE,1390006
181
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js,sha256=5YLXH9YrEcyuTYXT9Ko_VJhj-CEJX9J2K9ILSlypLt8,5831
182
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map,sha256=mUU_J-LI5MzCUorOfESVGeaop5hs344g-agqSgEkTak,6760
183
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.3f3c98eaba66bf084c66.js,sha256=1DRKFWe6E2rBXUjwu6wNxNaC3xKgd1plhkgwscl4mak,37699
184
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.3f3c98eaba66bf084c66.js.map,sha256=mDxlpZ5OZ7M7EhdhPzKxI-PmCOT0HlHLSI_F9Rs7New,36409
185
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/style.js,sha256=ymGkha4YxU1j3e7KeoKfqYpcsPp1u3RRuHzMaiUnOhw,150
186
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js,sha256=3WQEODsCgCQGEsrSnXaCIb-LlQYJ9k55le76mlBk5xs,33936
187
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js.map,sha256=Nc8hZfBEyXo3MHs-CN2h5l794OtFsz7ok7L-4qh2H6c,28742
188
- mito_ai-0.1.54.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
189
- mito_ai-0.1.54.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
190
- mito_ai-0.1.54.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
191
- mito_ai-0.1.54.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
192
- mito_ai-0.1.54.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
193
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map,sha256=dBmkthEcsYp8b1aZ-SHek5VkKnfR0gegHxpxNWmQshk,39713
194
- mito_ai-0.1.54.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
195
- mito_ai-0.1.54.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
196
- mito_ai-0.1.54.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
197
- mito_ai-0.1.54.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
198
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js,sha256=uYUAFa0GVVYcoVvYcw9cvNeF3OdZidQJVIrUE3UtRMQ,84610
199
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map,sha256=C0IxSaFYPj6nwxyvYGf9LLdBTFTKk93pPYEikFa1YQc,87246
200
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js,sha256=5gfmIE7bAaJYJZdTp5WuyTW6dKdU545i3X4LTSmiEcM,223110
201
- mito_ai-0.1.54.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map,sha256=azV-DYUA9Yp99BcesR3Q0DzRIiD64xVRhE4lDbvK3Sg,245869
202
- mito_ai-0.1.54.dist-info/METADATA,sha256=DFPLXEFnqPwX5uZHusujgIkZ1T_maQyXfurlrcQPqM8,7563
203
- mito_ai-0.1.54.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
204
- mito_ai-0.1.54.dist-info/entry_points.txt,sha256=OGsjpFBUq1QsuAlA3r2PeZXRwnnIWvzfgVhUqmx4qe4,79
205
- mito_ai-0.1.54.dist-info/licenses/LICENSE,sha256=O2F2Pp4Q1SmfzgYnl8krdrXZOaEo7Chjhk7OTYuGlDw,115
206
- mito_ai-0.1.54.dist-info/RECORD,,
190
+ mito_ai-0.1.56.data/data/etc/jupyter/jupyter_server_config.d/mito_ai.json,sha256=jnrJTWHAtiNWoD0APwyPSP0v4oXBO9aAqGwzTCq7ij8,82
191
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/build_log.json,sha256=0OASFF2vDQxAoGEVMUwmdWyJumNZNA5zzjApBLKu-4s,24285
192
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/package.json,sha256=UYpE5YF8TUD9ZA4-mrCeGqHz18HT6ZjywdCaVGAMBF8,7342
193
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig,sha256=HeCnyH4CgDFuE_HXPnZdA7swSDsob-iZW5P_AUCm0Z0,7200
194
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json,sha256=ec8DpF_QTgroq8BgLhmo1G2ByPPF-_tCnG3qRVq4qRE,894
195
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.dfd7975de75d64db80d6.js,sha256=tBFwt66cMLcOC3OSpazFO7YjPeZ71NTjSAKOh2J-yac,1502535
196
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.dfd7975de75d64db80d6.js.map,sha256=STWlXvztsxrH63DoOwafn9ZYRO9NjpHgmtVhDkBE8Pc,1531479
197
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js,sha256=5YLXH9YrEcyuTYXT9Ko_VJhj-CEJX9J2K9ILSlypLt8,5831
198
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map,sha256=mUU_J-LI5MzCUorOfESVGeaop5hs344g-agqSgEkTak,6760
199
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.1e7b5cf362385f109883.js,sha256=NQ1f11He-oKrXfwq1FoiF6UiCjZPH8_9Wy9m_g_d2Sg,37928
200
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.1e7b5cf362385f109883.js.map,sha256=gOQRpq3nToXRMKiv5rL8MGujfyBwhqkIAmxHZ50_lp8,36639
201
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/style.js,sha256=ymGkha4YxU1j3e7KeoKfqYpcsPp1u3RRuHzMaiUnOhw,150
202
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js,sha256=I5Tbj3I3be-EAs9zsatymPNQMwvt-OkXztMu9poDrto,34327
203
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js.map,sha256=QGA8jQzVFE2hVOKLeyhFlcZ_CC6JkgntOGzXpDXMP3Y,29252
204
+ mito_ai-0.1.56.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
205
+ mito_ai-0.1.56.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
206
+ mito_ai-0.1.56.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
207
+ mito_ai-0.1.56.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
208
+ mito_ai-0.1.56.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
209
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map,sha256=dBmkthEcsYp8b1aZ-SHek5VkKnfR0gegHxpxNWmQshk,39713
210
+ mito_ai-0.1.56.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
211
+ mito_ai-0.1.56.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
212
+ mito_ai-0.1.56.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
213
+ mito_ai-0.1.56.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
214
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js,sha256=uYUAFa0GVVYcoVvYcw9cvNeF3OdZidQJVIrUE3UtRMQ,84610
215
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map,sha256=C0IxSaFYPj6nwxyvYGf9LLdBTFTKk93pPYEikFa1YQc,87246
216
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js,sha256=5gfmIE7bAaJYJZdTp5WuyTW6dKdU545i3X4LTSmiEcM,223110
217
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map,sha256=azV-DYUA9Yp99BcesR3Q0DzRIiD64xVRhE4lDbvK3Sg,245869
218
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.css,sha256=T967CbDAdbXR6VWtF2gOyAnxJs_YSKFJX9_JwRlPJGc,25405
219
+ mito_ai-0.1.56.data/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.js,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
220
+ mito_ai-0.1.56.dist-info/METADATA,sha256=LQ77-DdP83p2Cm1vWr1lOfd0XHjacyPfb0i35XquXts,7756
221
+ mito_ai-0.1.56.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
222
+ mito_ai-0.1.56.dist-info/entry_points.txt,sha256=OGsjpFBUq1QsuAlA3r2PeZXRwnnIWvzfgVhUqmx4qe4,79
223
+ mito_ai-0.1.56.dist-info/licenses/LICENSE,sha256=O2F2Pp4Q1SmfzgYnl8krdrXZOaEo7Chjhk7OTYuGlDw,115
224
+ mito_ai-0.1.56.dist-info/RECORD,,
@@ -1,84 +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 typing import List, Optional, Dict
5
- from mito_ai.rules.utils import get_rule
6
-
7
-
8
- def get_rules_str(additional_context: Optional[List[Dict[str, str]]]) -> str:
9
- """
10
- Extract the rules from the additional context array, and retrieve the rule content.
11
- """
12
- if not additional_context:
13
- return ""
14
-
15
- selected_rules = [context["value"] for context in additional_context if context.get("type") == "rule"]
16
- if len(selected_rules) == 0:
17
- return ""
18
-
19
- rules_str = ""
20
- for rule in selected_rules:
21
- rule_content = get_rule(rule)
22
- if rule_content is None or rule_content == "":
23
- continue
24
-
25
- rules_str += f"===========\n\nCustom Instructions Provided by User: {rule}\n\n{rule_content}\n\n==========="
26
-
27
- return rules_str
28
-
29
-
30
- def get_selected_context_str(additional_context: Optional[List[Dict[str, str]]]) -> str:
31
- """
32
- Get the selected context from the additional context array.
33
- """
34
- if not additional_context:
35
- return ""
36
-
37
- # STEP 1: Extract each context type into a separate list
38
- selected_variables = [context["value"] for context in additional_context if context.get("type") == "variable"]
39
- selected_files = [context["value"] for context in additional_context if context.get("type") == "file"]
40
- selected_db_connections = [context["value"] for context in additional_context if context.get("type") == "db"]
41
- selected_images = [context["value"] for context in additional_context if context.get("type", "").startswith("image/")]
42
-
43
- # STEP 2: Create a list of strings (instructions) for each context type
44
- context_parts = []
45
-
46
- if len(selected_variables) > 0:
47
- context_parts.append(
48
- "The following variables have been selected by the user to be used in the task:\n"
49
- + "\n".join(selected_variables)
50
- )
51
-
52
- if len(selected_files) > 0:
53
- context_parts.append(
54
- "The following files have been selected by the user to be used in the task:\n"
55
- + "\n".join(selected_files)
56
- )
57
-
58
- if len(selected_db_connections) > 0:
59
- context_parts.append(
60
- "The following database connections have been selected by the user to be used in the task:\n"
61
- + "\n".join(selected_db_connections)
62
- )
63
-
64
- if len(selected_images) > 0:
65
- context_parts.append(
66
- "The following images have been selected by the user to be used in the task:\n"
67
- + "\n".join(selected_images)
68
- )
69
-
70
- # STEP 3: Combine into a single string
71
- return "\n\n".join(context_parts)
72
-
73
-
74
- def get_streamlit_app_status_str(notebook_id: str, notebook_path: str) -> str:
75
- """
76
- Get the streamlit app status string.
77
- """
78
- from mito_ai.path_utils import does_notebook_id_have_corresponding_app
79
- if does_notebook_id_have_corresponding_app(notebook_id, notebook_path):
80
- return "The notebook has an existing Streamlit app that you can edit"
81
- return "The notebook does not have an existing Streamlit app. If you want to show an app to the user, you must create a new one."
82
-
83
-
84
-