iatoolkit 2.2.4__tar.gz → 2.3.0__tar.gz
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.
- {iatoolkit-2.2.4/src/iatoolkit.egg-info → iatoolkit-2.3.0}/PKG-INFO +1 -1
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/__init__.py +1 -1
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/routes.py +7 -0
- iatoolkit-2.3.0/src/iatoolkit/config/system_prompts_pack.yaml +106 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/locales/en.yaml +15 -4
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/locales/es.yaml +15 -4
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/llm_query_repo.py +21 -23
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/models.py +51 -4
- iatoolkit-2.3.0/src/iatoolkit/repositories/prompt_resource_repo.py +40 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/company_context_service.py +21 -1
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/configuration_service.py +12 -9
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/context_builder_service.py +182 -10
- iatoolkit-2.3.0/src/iatoolkit/services/prompt_resource_service.py +182 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/prompt_service.py +81 -31
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/query_service.py +190 -37
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/system_prompt_catalog.py +102 -7
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/chat_state_rules.prompt +5 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/chat_user_profile.prompt +6 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/core_identity.prompt +6 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/email_output.prompt +6 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/file_download_output.prompt +10 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/html_structures.prompt +14 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/links_documents.prompt +26 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/multimodal_basics.prompt +6 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/output_basics.prompt +8 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/presentation_formatting.prompt +10 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/sql_aggregation_scope.prompt +14 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/sql_casting.prompt +14 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/sql_core.prompt +9 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/sql_jsonb.prompt +12 -0
- iatoolkit-2.3.0/src/iatoolkit/system_prompts/tool_html_passthrough.prompt +8 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/categories_api_view.py +4 -4
- iatoolkit-2.3.0/src/iatoolkit/views/prompt_resource_api_view.py +90 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0/src/iatoolkit.egg-info}/PKG-INFO +1 -1
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit.egg-info/SOURCES.txt +18 -0
- iatoolkit-2.2.4/src/iatoolkit/config/system_prompts_pack.yaml +0 -13
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/LICENSE +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/LICENSE_COMMUNITY.md +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/pyproject.toml +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/readme.md +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/requirements.txt +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/setup.cfg +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/base_company.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/cli_commands.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/exceptions.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/interfaces/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/interfaces/asset_storage.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/interfaces/database_provider.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/interfaces/memory_compilation_trigger.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/interfaces/memory_lint_trigger.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/interfaces/secret_provider.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/interfaces/signup_policy_resolver.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/interfaces/web_search_provider.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/model_registry.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/secret_resolver.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/session_manager.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/common/util.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/company_registry.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/config/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/config/llm_capabilities.yaml +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/config/system_tools_pack.yaml +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/core.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/brevo_mail_app.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/call_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/connectors/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/connectors/file_connector.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/connectors/file_connector_factory.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/connectors/google_cloud_storage_connector.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/connectors/google_drive_connector.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/connectors/local_file_connector.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/connectors/s3_connector.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/google_auth_client.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/google_chat_app.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/inference_embeddings_client.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/inference_handler.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/jina_embeddings_client.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/llm_providers/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/llm_providers/anthropic_adapter.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/llm_providers/deepseek_adapter.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/llm_providers/gemini_adapter.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/llm_providers/openai_adapter.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/llm_providers/openai_compatible_chat_adapter.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/llm_proxy.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/llm_response.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/infra/redis_session_manager.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/api_key_repo.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/database_manager.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/document_repo.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/env_secret_provider.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/filesystem_asset_repository.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/memory_repo.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/profile_repo.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/sql_dataset_repo.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/sql_source_repo.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/repositories/vs_repo.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/api_key_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/attachment_policy_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/auth_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/benchmark_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/branding_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/dispatcher_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/embedding_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/excel_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/file_processor_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/history_manager_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/http_tool_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/i18n_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/inference_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/jwt_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/knowledge_base_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/language_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/license_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/llm_client_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/mail_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/memory_compiler_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/memory_lint_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/memory_lookup_policy_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/memory_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/memory_wiki_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/noop_memory_compilation_trigger.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/noop_memory_lint_trigger.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/contracts.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/image_normalizer.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/parsing_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/pdf_ocr_detection.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/provider_factory.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/provider_resolver.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/providers/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/providers/basic_provider.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/providers/docling_provider.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/parsers/validator.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/pdf_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/profile_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/signup_policy_resolver.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/sql_dataset_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/sql_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/sql_source_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/storage_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/structured_output_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/system_tools.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/tool_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/user_feedback_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/user_session_context_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/visual_kb_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/visual_tool_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/warmup_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/web_search/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/web_search/provider_factory.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/web_search/providers/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/web_search/providers/brave_provider.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/services/web_search_service.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/images/fernando.jpeg +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/images/iatoolkit_core.png +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/images/iatoolkit_logo.png +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_feedback_button.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_filepond.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_help_content.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_history_button.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_logout_button.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_main.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_memory_button.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_model_selector.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_onboarding_button.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_prompt_manager.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/js/chat_reload_button.js +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/styles/chat_iatoolkit.css +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/styles/chat_modal.css +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/styles/chat_public.css +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/styles/documents.css +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/styles/landing_page.css +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/styles/llm_output.css +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/static/styles/onboarding.css +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/system_prompts/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/system_prompts/format_styles.prompt +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/system_prompts/query_main.prompt +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/system_prompts/sql_rules.prompt +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/_company_header.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/_login_widget.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/base.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/change_password.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/chat.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/chat_memory_modal.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/chat_modals.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/error.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/forgot_password.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/home_hosted_default.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/memory/wiki_schema.md +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/onboarding_shell.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/pdf/base.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/pdf/letter.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/pdf/report.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/pdf/simple.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/templates/signup.html +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/__init__.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/api_key_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/base_login_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/change_password_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/chat_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/configuration_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/connectors_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/embedding_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/forgot_password_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/help_content_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/history_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/home_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/init_context_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/llmquery_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/load_document_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/login_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/logout_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/memory_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/profile_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/prompt_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/rag_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/root_redirect_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/signup_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/static_page_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/tool_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/user_feedback_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/users_api_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit/views/verify_user_view.py +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit.egg-info/dependency_links.txt +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit.egg-info/requires.txt +0 -0
- {iatoolkit-2.2.4 → iatoolkit-2.3.0}/src/iatoolkit.egg-info/top_level.txt +0 -0
|
@@ -22,6 +22,7 @@ def register_views(app):
|
|
|
22
22
|
from iatoolkit.views.load_document_api_view import LoadDocumentApiView
|
|
23
23
|
from iatoolkit.views.user_feedback_api_view import UserFeedbackApiView
|
|
24
24
|
from iatoolkit.views.prompt_api_view import PromptApiView
|
|
25
|
+
from iatoolkit.views.prompt_resource_api_view import PromptResourceApiView
|
|
25
26
|
from iatoolkit.views.history_api_view import HistoryApiView
|
|
26
27
|
from iatoolkit.views.help_content_api_view import HelpContentApiView
|
|
27
28
|
from iatoolkit.views.profile_api_view import UserLanguageApiView
|
|
@@ -121,6 +122,12 @@ def register_views(app):
|
|
|
121
122
|
app.add_url_rule('/<company_short_name>/api/prompts/<prompt_name>',
|
|
122
123
|
view_func=prompt_view,
|
|
123
124
|
methods=['GET', 'POST','PUT', 'DELETE'])
|
|
125
|
+
|
|
126
|
+
app.add_url_rule(
|
|
127
|
+
'/<string:company_short_name>/api/admin/prompts/<string:prompt_name>/resources',
|
|
128
|
+
view_func=PromptResourceApiView.as_view('prompt_resources_api'),
|
|
129
|
+
methods=['GET', 'PUT'],
|
|
130
|
+
)
|
|
124
131
|
# toolbar buttons
|
|
125
132
|
app.add_url_rule('/<company_short_name>/api/feedback', view_func=UserFeedbackApiView.as_view('feedback'))
|
|
126
133
|
app.add_url_rule('/<company_short_name>/api/history', view_func=HistoryApiView.as_view('history'))
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
prompts:
|
|
3
|
+
- key: core_identity
|
|
4
|
+
filename: core_identity.prompt
|
|
5
|
+
include:
|
|
6
|
+
execution_modes:
|
|
7
|
+
- chat
|
|
8
|
+
- agent
|
|
9
|
+
- key: chat_user_profile
|
|
10
|
+
filename: chat_user_profile.prompt
|
|
11
|
+
include:
|
|
12
|
+
execution_modes:
|
|
13
|
+
- chat
|
|
14
|
+
- key: chat_state_rules
|
|
15
|
+
filename: chat_state_rules.prompt
|
|
16
|
+
include:
|
|
17
|
+
execution_modes:
|
|
18
|
+
- chat
|
|
19
|
+
- key: links_documents
|
|
20
|
+
filename: links_documents.prompt
|
|
21
|
+
include:
|
|
22
|
+
execution_modes:
|
|
23
|
+
- chat
|
|
24
|
+
- agent
|
|
25
|
+
- key: multimodal_basics
|
|
26
|
+
filename: multimodal_basics.prompt
|
|
27
|
+
include:
|
|
28
|
+
execution_modes:
|
|
29
|
+
- chat
|
|
30
|
+
- agent
|
|
31
|
+
- key: output_basics
|
|
32
|
+
filename: output_basics.prompt
|
|
33
|
+
include:
|
|
34
|
+
execution_modes:
|
|
35
|
+
- chat
|
|
36
|
+
- agent
|
|
37
|
+
response_modes:
|
|
38
|
+
- chat_compatible
|
|
39
|
+
- key: presentation_formatting
|
|
40
|
+
filename: presentation_formatting.prompt
|
|
41
|
+
include:
|
|
42
|
+
execution_modes:
|
|
43
|
+
- chat
|
|
44
|
+
response_modes:
|
|
45
|
+
- chat_compatible
|
|
46
|
+
- key: html_structures
|
|
47
|
+
filename: html_structures.prompt
|
|
48
|
+
include:
|
|
49
|
+
execution_modes:
|
|
50
|
+
- chat
|
|
51
|
+
response_modes:
|
|
52
|
+
- chat_compatible
|
|
53
|
+
- key: tool_html_passthrough
|
|
54
|
+
filename: tool_html_passthrough.prompt
|
|
55
|
+
include:
|
|
56
|
+
execution_modes:
|
|
57
|
+
- chat
|
|
58
|
+
- agent
|
|
59
|
+
- key: file_download_output
|
|
60
|
+
filename: file_download_output.prompt
|
|
61
|
+
include:
|
|
62
|
+
execution_modes:
|
|
63
|
+
- chat
|
|
64
|
+
- agent
|
|
65
|
+
all_capabilities:
|
|
66
|
+
- can_generate_files
|
|
67
|
+
- key: email_output
|
|
68
|
+
filename: email_output.prompt
|
|
69
|
+
include:
|
|
70
|
+
execution_modes:
|
|
71
|
+
- chat
|
|
72
|
+
- agent
|
|
73
|
+
all_capabilities:
|
|
74
|
+
- can_send_email
|
|
75
|
+
- key: sql_core
|
|
76
|
+
filename: sql_core.prompt
|
|
77
|
+
include:
|
|
78
|
+
execution_modes:
|
|
79
|
+
- chat
|
|
80
|
+
- agent
|
|
81
|
+
all_capabilities:
|
|
82
|
+
- can_query_sql
|
|
83
|
+
- key: sql_jsonb
|
|
84
|
+
filename: sql_jsonb.prompt
|
|
85
|
+
include:
|
|
86
|
+
execution_modes:
|
|
87
|
+
- chat
|
|
88
|
+
- agent
|
|
89
|
+
all_capabilities:
|
|
90
|
+
- can_query_sql
|
|
91
|
+
- key: sql_casting
|
|
92
|
+
filename: sql_casting.prompt
|
|
93
|
+
include:
|
|
94
|
+
execution_modes:
|
|
95
|
+
- chat
|
|
96
|
+
- agent
|
|
97
|
+
all_capabilities:
|
|
98
|
+
- can_query_sql
|
|
99
|
+
- key: sql_aggregation_scope
|
|
100
|
+
filename: sql_aggregation_scope.prompt
|
|
101
|
+
include:
|
|
102
|
+
execution_modes:
|
|
103
|
+
- chat
|
|
104
|
+
- agent
|
|
105
|
+
all_capabilities:
|
|
106
|
+
- can_query_sql
|
|
@@ -312,14 +312,14 @@ ui:
|
|
|
312
312
|
restore_failed: "Failed to restore skill version."
|
|
313
313
|
restore_ok: "Skill version restored."
|
|
314
314
|
readonly_message: "Skill editing requires admin or owner role."
|
|
315
|
-
uncategorized: "
|
|
315
|
+
uncategorized: "General"
|
|
316
316
|
binding_label: "Binding {number}"
|
|
317
317
|
resource_type_label: "Resource type"
|
|
318
318
|
resource_key_label: "Resource key"
|
|
319
319
|
resource_key_placeholder: "routing.yaml or collection name"
|
|
320
320
|
metadata_json_label: "Metadata JSON"
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
execution_mode_agentic: "Agentic"
|
|
322
|
+
execution_mode_conversational: "Conversational"
|
|
323
323
|
resource_type_tool: "Tool"
|
|
324
324
|
resource_type_rag_collection: "RAG collection"
|
|
325
325
|
resource_type_sql_source: "SQL source"
|
|
@@ -661,6 +661,9 @@ ui:
|
|
|
661
661
|
definition_error_loading: "Could not load pipeline definition"
|
|
662
662
|
definition_error_loading_list: "Could not load pipeline definitions"
|
|
663
663
|
no_definitions: "No pipeline definitions yet."
|
|
664
|
+
no_active_definitions: "No active pipeline definitions."
|
|
665
|
+
show_inactive: "Show inactive"
|
|
666
|
+
definitions_filter_summary: "Showing {visible} of {total} pipelines"
|
|
664
667
|
definition_last_run: "Last run"
|
|
665
668
|
definition_no_runs: "No runs"
|
|
666
669
|
definition_column_pipeline: "Pipeline"
|
|
@@ -984,12 +987,13 @@ ui:
|
|
|
984
987
|
tab_editor: "Editor"
|
|
985
988
|
tab_output: "Output"
|
|
986
989
|
tab_tools: "Tools"
|
|
990
|
+
tab_resources: "Resources"
|
|
987
991
|
tab_playground: "Playground"
|
|
988
992
|
config_title: "Config"
|
|
989
993
|
desc_label: "Description"
|
|
990
994
|
desc_placeholder: "Describe this prompt..."
|
|
991
995
|
vars_label: "Input Variables"
|
|
992
|
-
|
|
996
|
+
execution_mode_label: "Execution Mode"
|
|
993
997
|
active_label: "Active"
|
|
994
998
|
output_type_label: "Output Type"
|
|
995
999
|
output_type_free_text: "Free text"
|
|
@@ -1056,6 +1060,13 @@ ui:
|
|
|
1056
1060
|
tools_type_http: "HTTP"
|
|
1057
1061
|
tools_type_native: "NATIVE"
|
|
1058
1062
|
tools_type_system: "SYSTEM"
|
|
1063
|
+
resources_title: "Agent Resources"
|
|
1064
|
+
resources_help: "Define the data scope visible to this agent. Only typed resources relevant to the selected tools are shown."
|
|
1065
|
+
resources_sql_title: "SQL Sources"
|
|
1066
|
+
resources_sql_help: "Select the SQL sources this agent can use."
|
|
1067
|
+
resources_rag_title: "RAG Collections"
|
|
1068
|
+
resources_rag_help: "Select the document collections this agent can search."
|
|
1069
|
+
resources_memory_hint: "Memory tools use the current user scope and do not require extra bindings."
|
|
1059
1070
|
run_btn: "Run"
|
|
1060
1071
|
copy_html_btn: "Copy HTML"
|
|
1061
1072
|
copy_json_btn: "Copy JSON"
|
|
@@ -312,14 +312,14 @@ ui:
|
|
|
312
312
|
restore_failed: "No se pudo restaurar la versión de la skill."
|
|
313
313
|
restore_ok: "Versión de skill restaurada."
|
|
314
314
|
readonly_message: "La edición de skills requiere rol admin u owner."
|
|
315
|
-
uncategorized: "
|
|
315
|
+
uncategorized: "General"
|
|
316
316
|
binding_label: "Binding {number}"
|
|
317
317
|
resource_type_label: "Tipo de recurso"
|
|
318
318
|
resource_key_label: "Key del recurso"
|
|
319
319
|
resource_key_placeholder: "routing.yaml o nombre de colección"
|
|
320
320
|
metadata_json_label: "Metadata JSON"
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
execution_mode_agentic: "Agéntico"
|
|
322
|
+
execution_mode_conversational: "Conversacional"
|
|
323
323
|
resource_type_tool: "Tool"
|
|
324
324
|
resource_type_rag_collection: "Colección RAG"
|
|
325
325
|
resource_type_sql_source: "Fuente SQL"
|
|
@@ -662,6 +662,9 @@ ui:
|
|
|
662
662
|
definition_error_loading: "No se pudo cargar la definición de pipeline"
|
|
663
663
|
definition_error_loading_list: "No se pudieron cargar las definiciones de pipeline"
|
|
664
664
|
no_definitions: "Todavía no hay definiciones de pipeline."
|
|
665
|
+
no_active_definitions: "No hay definiciones de pipeline activas."
|
|
666
|
+
show_inactive: "Mostrar inactivas"
|
|
667
|
+
definitions_filter_summary: "Mostrando {visible} de {total} pipelines"
|
|
665
668
|
definition_last_run: "Última ejecución"
|
|
666
669
|
definition_no_runs: "Sin ejecuciones"
|
|
667
670
|
definition_column_pipeline: "Pipeline"
|
|
@@ -987,12 +990,13 @@ ui:
|
|
|
987
990
|
tab_editor: "Editor"
|
|
988
991
|
tab_output: "Salida"
|
|
989
992
|
tab_tools: "Tools"
|
|
993
|
+
tab_resources: "Recursos"
|
|
990
994
|
tab_playground: "Playground"
|
|
991
995
|
config_title: "Configuración"
|
|
992
996
|
desc_label: "Descripción"
|
|
993
997
|
desc_placeholder: "Describe este prompt..."
|
|
994
998
|
vars_label: "Variables de Entrada"
|
|
995
|
-
|
|
999
|
+
execution_mode_label: "Modo de ejecución"
|
|
996
1000
|
active_label: "Activo"
|
|
997
1001
|
output_type_label: "Tipo de Salida"
|
|
998
1002
|
output_type_free_text: "Texto libre"
|
|
@@ -1059,6 +1063,13 @@ ui:
|
|
|
1059
1063
|
tools_type_http: "HTTP"
|
|
1060
1064
|
tools_type_native: "NATIVE"
|
|
1061
1065
|
tools_type_system: "SYSTEM"
|
|
1066
|
+
resources_title: "Recursos del Agente"
|
|
1067
|
+
resources_help: "Define el alcance de datos visible para este agente. Solo se muestran recursos tipados relevantes para las tools seleccionadas."
|
|
1068
|
+
resources_sql_title: "Fuentes SQL"
|
|
1069
|
+
resources_sql_help: "Selecciona las fuentes SQL que este agente podrá usar."
|
|
1070
|
+
resources_rag_title: "Colecciones RAG"
|
|
1071
|
+
resources_rag_help: "Selecciona las colecciones documentales que este agente podrá consultar."
|
|
1072
|
+
resources_memory_hint: "Las tools de memoria usan el scope del usuario actual y no requieren bindings adicionales."
|
|
1062
1073
|
run_btn: "Ejecutar"
|
|
1063
1074
|
copy_html_btn: "Copiar HTML"
|
|
1064
1075
|
copy_json_btn: "Copiar JSON"
|
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
#
|
|
4
4
|
# IAToolkit is open source software.
|
|
5
5
|
|
|
6
|
-
from iatoolkit.repositories.models import (
|
|
7
|
-
|
|
6
|
+
from iatoolkit.repositories.models import (
|
|
7
|
+
LLMQuery,
|
|
8
|
+
Tool,
|
|
9
|
+
Company,
|
|
10
|
+
Prompt,
|
|
11
|
+
PromptCategory,
|
|
12
|
+
PromptExecutionMode,
|
|
13
|
+
)
|
|
8
14
|
from injector import inject
|
|
9
15
|
from iatoolkit.repositories.database_manager import DatabaseManager
|
|
10
16
|
from sqlalchemy import or_, and_
|
|
@@ -134,36 +140,19 @@ class LLMQueryRepo:
|
|
|
134
140
|
return self.session.query(Prompt).filter_by(company_id=company.id, name=prompt_name).first()
|
|
135
141
|
|
|
136
142
|
def get_prompts(self, company: Company, include_all: bool = False) -> list[Prompt]:
|
|
137
|
-
editable_types = [PromptType.COMPANY.value, PromptType.AGENT.value]
|
|
138
143
|
if include_all:
|
|
139
144
|
# Include all prompts (for the prompt admin dashboard)
|
|
140
145
|
return self.session.query(Prompt).filter(
|
|
141
146
|
Prompt.company_id == company.id,
|
|
142
|
-
Prompt.prompt_type.in_(editable_types),
|
|
143
147
|
).all()
|
|
144
148
|
else:
|
|
145
|
-
# Only active
|
|
149
|
+
# Only active prompts explicitly exposed in chat for end users.
|
|
146
150
|
return self.session.query(Prompt).filter(
|
|
147
151
|
Prompt.company_id == company.id,
|
|
148
|
-
Prompt.
|
|
149
|
-
Prompt.active
|
|
152
|
+
Prompt.visible_in_chat.is_(True),
|
|
153
|
+
Prompt.active.is_(True),
|
|
150
154
|
).all()
|
|
151
155
|
|
|
152
|
-
def delete_prompts_by_type(self, company_id: int, prompt_types: list[str]) -> int:
|
|
153
|
-
if not prompt_types:
|
|
154
|
-
return 0
|
|
155
|
-
|
|
156
|
-
deleted_count = (
|
|
157
|
-
self.session.query(Prompt)
|
|
158
|
-
.filter(
|
|
159
|
-
Prompt.company_id == company_id,
|
|
160
|
-
Prompt.prompt_type.in_(prompt_types),
|
|
161
|
-
)
|
|
162
|
-
.delete(synchronize_session=False)
|
|
163
|
-
)
|
|
164
|
-
self.session.commit()
|
|
165
|
-
return int(deleted_count or 0)
|
|
166
|
-
|
|
167
156
|
def create_or_update_prompt(self, new_prompt: Prompt):
|
|
168
157
|
prompt = self.session.query(Prompt).filter_by(company_id=new_prompt.company_id,
|
|
169
158
|
name=new_prompt.name).first()
|
|
@@ -171,7 +160,12 @@ class LLMQueryRepo:
|
|
|
171
160
|
prompt.category_id = new_prompt.category_id
|
|
172
161
|
prompt.description = new_prompt.description
|
|
173
162
|
prompt.order = new_prompt.order
|
|
174
|
-
prompt.
|
|
163
|
+
prompt.visible_in_chat = bool(getattr(new_prompt, "visible_in_chat", True))
|
|
164
|
+
prompt.execution_mode = (
|
|
165
|
+
getattr(new_prompt, "execution_mode", None)
|
|
166
|
+
or prompt.execution_mode
|
|
167
|
+
or PromptExecutionMode.CONVERSATIONAL.value
|
|
168
|
+
)
|
|
175
169
|
prompt.filename = new_prompt.filename
|
|
176
170
|
prompt.custom_fields = new_prompt.custom_fields
|
|
177
171
|
prompt.output_schema = new_prompt.output_schema
|
|
@@ -189,6 +183,10 @@ class LLMQueryRepo:
|
|
|
189
183
|
prompt.llm_request_options = dict(new_prompt.llm_request_options or {})
|
|
190
184
|
prompt.tool_policy = dict(new_prompt.tool_policy or {})
|
|
191
185
|
else:
|
|
186
|
+
if new_prompt.visible_in_chat is None:
|
|
187
|
+
new_prompt.visible_in_chat = True
|
|
188
|
+
if not new_prompt.execution_mode:
|
|
189
|
+
new_prompt.execution_mode = PromptExecutionMode.CONVERSATIONAL.value
|
|
192
190
|
if not new_prompt.output_schema_mode:
|
|
193
191
|
new_prompt.output_schema_mode = "best_effort"
|
|
194
192
|
if not new_prompt.output_response_mode:
|
|
@@ -30,9 +30,15 @@ class DocumentStatus(str, enum.Enum):
|
|
|
30
30
|
ACTIVE = "active"
|
|
31
31
|
FAILED = "failed"
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
|
|
34
|
+
class PromptExecutionMode(str, enum.Enum):
|
|
35
|
+
CONVERSATIONAL = "conversational"
|
|
36
|
+
AGENTIC = "agentic"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class PromptResourceType(str, enum.Enum):
|
|
40
|
+
SQL_SOURCE = "sql_source"
|
|
41
|
+
RAG_COLLECTION = "rag_collection"
|
|
36
42
|
|
|
37
43
|
|
|
38
44
|
class MemoryItemType(str, enum.Enum):
|
|
@@ -545,7 +551,8 @@ class Prompt(Base):
|
|
|
545
551
|
description = Column(String, nullable=False)
|
|
546
552
|
filename = Column(String, nullable=False)
|
|
547
553
|
active = Column(Boolean, default=True)
|
|
548
|
-
|
|
554
|
+
visible_in_chat = Column(Boolean, default=True, nullable=False)
|
|
555
|
+
execution_mode = Column(String, default=PromptExecutionMode.CONVERSATIONAL.value, nullable=False)
|
|
549
556
|
order = Column(Integer, nullable=True, default=0)
|
|
550
557
|
category_id = Column(Integer, ForeignKey(f'{ORM_SCHEMA}.iat_prompt_categories.id', ondelete='SET NULL'), nullable=True)
|
|
551
558
|
custom_fields = Column(JSON, nullable=False, default=[])
|
|
@@ -560,11 +567,51 @@ class Prompt(Base):
|
|
|
560
567
|
llm_request_options = Column(JSON_NATIVE, nullable=False, default=dict)
|
|
561
568
|
tool_policy = Column(JSON_NATIVE, nullable=False, default=dict)
|
|
562
569
|
created_at = Column(DateTime, default=datetime.now)
|
|
570
|
+
|
|
563
571
|
def to_dict(self):
|
|
564
572
|
return {column.key: getattr(self, column.key) for column in class_mapper(self.__class__).columns}
|
|
565
573
|
|
|
566
574
|
company = relationship("Company", back_populates="prompts")
|
|
567
575
|
category = relationship("PromptCategory", back_populates="prompts")
|
|
576
|
+
resource_bindings = relationship(
|
|
577
|
+
"PromptResourceBinding",
|
|
578
|
+
back_populates="prompt",
|
|
579
|
+
cascade="all, delete-orphan",
|
|
580
|
+
order_by="PromptResourceBinding.binding_order",
|
|
581
|
+
)
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
class PromptResourceBinding(Base):
|
|
585
|
+
__tablename__ = "iat_prompt_resource_bindings"
|
|
586
|
+
|
|
587
|
+
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
588
|
+
prompt_id = Column(
|
|
589
|
+
Integer,
|
|
590
|
+
ForeignKey(f"{ORM_SCHEMA}.iat_prompt.id", ondelete="CASCADE"),
|
|
591
|
+
nullable=False,
|
|
592
|
+
index=True,
|
|
593
|
+
)
|
|
594
|
+
resource_type = Column(String(32), nullable=False, index=True)
|
|
595
|
+
resource_key = Column(String(255), nullable=False)
|
|
596
|
+
binding_order = Column(Integer, nullable=False, default=0)
|
|
597
|
+
metadata_json = Column(JSON_NATIVE, nullable=False, default=dict)
|
|
598
|
+
created_at = Column(DateTime, default=datetime.now)
|
|
599
|
+
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)
|
|
600
|
+
updated_by = Column(String(100), nullable=True)
|
|
601
|
+
|
|
602
|
+
__table_args__ = (
|
|
603
|
+
UniqueConstraint(
|
|
604
|
+
"prompt_id",
|
|
605
|
+
"resource_type",
|
|
606
|
+
"resource_key",
|
|
607
|
+
name="uix_prompt_resource_binding_resource_key",
|
|
608
|
+
),
|
|
609
|
+
)
|
|
610
|
+
|
|
611
|
+
prompt = relationship("Prompt", back_populates="resource_bindings")
|
|
612
|
+
|
|
613
|
+
def to_dict(self):
|
|
614
|
+
return {column.key: getattr(self, column.key) for column in class_mapper(self.__class__).columns}
|
|
568
615
|
|
|
569
616
|
|
|
570
617
|
class SqlSource(Base):
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Copyright (c) 2024 Fernando Libedinsky
|
|
2
|
+
# Product: IAToolkit
|
|
3
|
+
#
|
|
4
|
+
# IAToolkit is open source software.
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from injector import inject
|
|
9
|
+
|
|
10
|
+
from iatoolkit.repositories.database_manager import DatabaseManager
|
|
11
|
+
from iatoolkit.repositories.models import PromptResourceBinding
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PromptResourceRepo:
|
|
15
|
+
@inject
|
|
16
|
+
def __init__(self, db_manager: DatabaseManager):
|
|
17
|
+
self.session = db_manager.get_session()
|
|
18
|
+
|
|
19
|
+
def list_by_prompt(self, prompt_id: int) -> list[PromptResourceBinding]:
|
|
20
|
+
return (
|
|
21
|
+
self.session.query(PromptResourceBinding)
|
|
22
|
+
.filter(PromptResourceBinding.prompt_id == prompt_id)
|
|
23
|
+
.order_by(PromptResourceBinding.binding_order.asc(), PromptResourceBinding.id.asc())
|
|
24
|
+
.all()
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def replace_bindings(
|
|
28
|
+
self,
|
|
29
|
+
prompt_id: int,
|
|
30
|
+
bindings: list[PromptResourceBinding],
|
|
31
|
+
) -> list[PromptResourceBinding]:
|
|
32
|
+
(
|
|
33
|
+
self.session.query(PromptResourceBinding)
|
|
34
|
+
.filter(PromptResourceBinding.prompt_id == prompt_id)
|
|
35
|
+
.delete(synchronize_session="fetch")
|
|
36
|
+
)
|
|
37
|
+
for binding in bindings:
|
|
38
|
+
self.session.add(binding)
|
|
39
|
+
self.session.commit()
|
|
40
|
+
return bindings
|
|
@@ -66,8 +66,18 @@ class CompanyContextService:
|
|
|
66
66
|
# Join all parts with a clear separator
|
|
67
67
|
return "\n\n---\n\n".join(context_parts)
|
|
68
68
|
|
|
69
|
+
def get_sql_context(self, company_short_name: str, allowed_databases: List[str] | None = None) -> str:
|
|
70
|
+
try:
|
|
71
|
+
sql_context, _ = self._get_sql_enriched_context(
|
|
72
|
+
company_short_name,
|
|
73
|
+
allowed_databases=allowed_databases,
|
|
74
|
+
)
|
|
75
|
+
return sql_context
|
|
76
|
+
except Exception as e:
|
|
77
|
+
logging.warning(f"Could not generate SQL context for '{company_short_name}': {e}")
|
|
78
|
+
return ""
|
|
69
79
|
|
|
70
|
-
def _get_sql_enriched_context(self, company_short_name: str):
|
|
80
|
+
def _get_sql_enriched_context(self, company_short_name: str, allowed_databases: List[str] | None = None):
|
|
71
81
|
"""
|
|
72
82
|
Generates the SQL context for the LLM using the enriched schema logic.
|
|
73
83
|
It iterates over configured databases, fetches their enriched structure,
|
|
@@ -77,6 +87,14 @@ class CompanyContextService:
|
|
|
77
87
|
if not sql_sources:
|
|
78
88
|
return '', []
|
|
79
89
|
|
|
90
|
+
allowed_database_set = {
|
|
91
|
+
str(database or "").strip()
|
|
92
|
+
for database in (allowed_databases or [])
|
|
93
|
+
if str(database or "").strip()
|
|
94
|
+
}
|
|
95
|
+
if allowed_databases is not None and not allowed_database_set:
|
|
96
|
+
return "", []
|
|
97
|
+
|
|
80
98
|
context_output = []
|
|
81
99
|
db_tables=[]
|
|
82
100
|
|
|
@@ -84,6 +102,8 @@ class CompanyContextService:
|
|
|
84
102
|
db_name = source.get('database')
|
|
85
103
|
if not db_name:
|
|
86
104
|
continue
|
|
105
|
+
if allowed_database_set and db_name not in allowed_database_set:
|
|
106
|
+
continue
|
|
87
107
|
|
|
88
108
|
try:
|
|
89
109
|
# 1. Get the Enriched Schema (Physical + YAML)
|
|
@@ -452,7 +452,7 @@ class ConfigurationService:
|
|
|
452
452
|
prompt_list, categories_config = self._get_prompt_config(config)
|
|
453
453
|
|
|
454
454
|
category_set = set(categories_config)
|
|
455
|
-
|
|
455
|
+
allowed_execution_modes = {"conversational", "agentic"}
|
|
456
456
|
allowed_output_schema_modes = {"best_effort", "strict"}
|
|
457
457
|
allowed_output_response_modes = {"chat_compatible", "structured_only"}
|
|
458
458
|
allowed_attachment_modes = {"extracted_only", "native_only", "native_plus_extracted"}
|
|
@@ -485,18 +485,21 @@ class ConfigurationService:
|
|
|
485
485
|
add_error(f"prompts[{i}]", "Missing required key: 'description'")
|
|
486
486
|
|
|
487
487
|
prompt_cat = prompt.get("category")
|
|
488
|
-
|
|
489
|
-
if
|
|
488
|
+
execution_mode = str(prompt.get("execution_mode", "") or "").strip().lower()
|
|
489
|
+
if execution_mode and execution_mode not in allowed_execution_modes:
|
|
490
490
|
add_error(
|
|
491
491
|
f"prompts[{i}]",
|
|
492
|
-
f"Unsupported
|
|
492
|
+
f"Unsupported execution_mode '{execution_mode}'. Must be one of: {sorted(allowed_execution_modes)}."
|
|
493
493
|
)
|
|
494
494
|
continue
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
495
|
+
|
|
496
|
+
visible_in_chat = prompt.get("visible_in_chat")
|
|
497
|
+
if visible_in_chat is not None and not isinstance(visible_in_chat, bool):
|
|
498
|
+
add_error(f"prompts[{i}].visible_in_chat", "Must be a boolean.")
|
|
499
|
+
continue
|
|
500
|
+
|
|
501
|
+
if prompt_cat and prompt_cat not in category_set:
|
|
502
|
+
add_error(f"prompts[{i}]", f"Category '{prompt_cat}' is not defined in 'prompt_categories'.")
|
|
500
503
|
|
|
501
504
|
schema_mode = str(prompt.get("output_schema_mode", "best_effort")).strip().lower()
|
|
502
505
|
if schema_mode not in allowed_output_schema_modes:
|