iatoolkit 2.32.0__tar.gz → 2.32.1__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.32.0/src/iatoolkit.egg-info → iatoolkit-2.32.1}/PKG-INFO +1 -1
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/__init__.py +1 -1
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/llm_query_repo.py +34 -35
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/models.py +54 -4
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/configuration_service.py +14 -9
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/context_builder_service.py +13 -13
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/prompt_service.py +121 -63
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/query_service.py +16 -23
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/prompt_api_view.py +9 -1
- {iatoolkit-2.32.0 → iatoolkit-2.32.1/src/iatoolkit.egg-info}/PKG-INFO +1 -1
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/LICENSE +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/LICENSE_COMMUNITY.md +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/pyproject.toml +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/readme.md +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/requirements.txt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/setup.cfg +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/base_company.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/cli_commands.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/exceptions.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/interfaces/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/interfaces/asset_storage.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/interfaces/database_provider.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/interfaces/memory_compilation_trigger.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/interfaces/memory_lint_trigger.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/interfaces/secret_provider.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/interfaces/signup_policy_resolver.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/interfaces/web_search_provider.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/model_registry.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/routes.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/secret_resolver.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/session_manager.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/common/util.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/company_registry.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/llm_capabilities.yaml +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/channel_business_identity.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/channel_conversation_continuity.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/channel_response_style.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/chat_state_rules.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/chat_user_profile.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/core_identity.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/email_output.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/file_download_output.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/format_styles.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/html_structures.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/links_documents.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/memory_usage.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/multimodal_basics.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/output_basics.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/presentation_formatting.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/query_main.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/sql_aggregation_scope.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/sql_casting.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/sql_core.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/sql_jsonb.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/sql_mysql_casting.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/sql_mysql_json.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/sql_redshift_basics.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/sql_redshift_types.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/sql_rules.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts/tool_html_passthrough.prompt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_prompts_pack.yaml +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/config/system_tools_pack.yaml +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/core.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/brevo_mail_app.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/call_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/connectors/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/connectors/file_connector.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/connectors/file_connector_factory.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/connectors/google_cloud_storage_connector.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/connectors/google_drive_connector.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/connectors/local_file_connector.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/connectors/s3_connector.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/google_auth_client.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/google_chat_app.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/inference_embeddings_client.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/inference_handler.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/jina_embeddings_client.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_gateway_resolver.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_providers/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_providers/anthropic_adapter.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_providers/deepseek_adapter.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_providers/gemini_adapter.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_providers/openai_adapter.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_providers/openai_compatible_chat_adapter.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_providers/openrouter_adapter.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_proxy.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/llm_response.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/infra/redis_session_manager.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/locales/en.yaml +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/locales/es.yaml +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/api_key_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/database_manager.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/document_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/env_secret_provider.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/filesystem_asset_repository.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/knowledge_wiki_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/mcp_token_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/memory_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/profile_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/prompt_resource_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/sql_dataset_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/sql_source_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/repositories/vs_repo.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/runtime_logging.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/api_key_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/attachment_policy_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/auth_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/benchmark_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/branding_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/company_context_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/dispatcher_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/embedding_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/excel_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/file_processor_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/history_manager_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/http_tool_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/i18n_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/inference_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/jwt_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/knowledge_base_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/language_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/license_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/llm_client_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/mail_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/markdown_wiki_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/mcp_token_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/memory_compiler_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/memory_lint_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/memory_lookup_policy_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/memory_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/memory_wiki_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/noop_memory_compilation_trigger.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/noop_memory_lint_trigger.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/contracts.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/image_normalizer.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/parsing_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/pdf_ocr_detection.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/provider_factory.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/provider_resolver.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/providers/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/providers/basic_provider.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/providers/docling_provider.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/parsers/validator.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/pdf_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/profile_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/prompt_resource_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/signup_policy_resolver.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/sql_dataset_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/sql_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/sql_source_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/storage_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/structured_output_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/system_prompt_catalog.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/system_tools.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/telemetry_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/tenant_wiki_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/tool_output_contract.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/tool_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/user_feedback_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/user_session_context_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/visual_kb_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/visual_tool_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/warmup_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/web_search/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/web_search/provider_factory.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/web_search/providers/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/web_search/providers/brave_provider.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/services/web_search_service.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/images/fernando.jpeg +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/images/iatoolkit_core.png +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/images/iatoolkit_logo.png +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_feedback_button.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_filepond.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_help_content.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_history_button.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_logout_button.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_main.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_memory_button.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_model_selector.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_onboarding_button.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_prompt_manager.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/js/chat_reload_button.js +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/styles/chat_iatoolkit.css +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/styles/chat_modal.css +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/styles/chat_public.css +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/styles/documents.css +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/styles/landing_page.css +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/styles/llm_output.css +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/static/styles/onboarding.css +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/_company_header.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/_login_widget.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/account.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/base.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/change_password.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/chat.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/chat_memory_modal.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/chat_modals.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/error.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/forgot_password.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/home_hosted_default.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/memory/wiki_schema.md +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/onboarding_shell.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/pdf/base.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/pdf/letter.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/pdf/report.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/pdf/simple.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/templates/signup.html +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/__init__.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/account_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/api_key_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/base_login_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/categories_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/change_password_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/chat_context_preview_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/chat_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/configuration_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/connectors_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/embedding_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/forgot_password_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/help_content_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/history_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/home_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/init_context_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/llmquery_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/load_document_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/login_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/logout_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/memory_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/profile_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/prompt_context_preview_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/prompt_resource_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/rag_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/root_redirect_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/signup_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/static_page_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/tool_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/user_feedback_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/users_api_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit/views/verify_user_view.py +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit.egg-info/SOURCES.txt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit.egg-info/dependency_links.txt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit.egg-info/requires.txt +0 -0
- {iatoolkit-2.32.0 → iatoolkit-2.32.1}/src/iatoolkit.egg-info/top_level.txt +0 -0
|
@@ -10,7 +10,6 @@ from iatoolkit.repositories.models import (
|
|
|
10
10
|
Prompt,
|
|
11
11
|
PromptAgentRole,
|
|
12
12
|
PromptCategory,
|
|
13
|
-
PromptExecutionMode,
|
|
14
13
|
)
|
|
15
14
|
from injector import inject
|
|
16
15
|
from iatoolkit.repositories.database_manager import DatabaseManager
|
|
@@ -147,16 +146,34 @@ class LLMQueryRepo:
|
|
|
147
146
|
return self.session.query(Prompt).filter(
|
|
148
147
|
Prompt.company_id == company.id,
|
|
149
148
|
).all()
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
149
|
+
|
|
150
|
+
# Only active prompts explicitly exposed in chat for end users.
|
|
151
|
+
prompts = self.session.query(Prompt).filter(
|
|
152
|
+
Prompt.company_id == company.id,
|
|
153
|
+
Prompt.active.is_(True),
|
|
154
|
+
).all()
|
|
155
|
+
return [
|
|
156
|
+
prompt for prompt in prompts
|
|
157
|
+
if self._get_prompt_runtime_role(prompt) in {
|
|
158
|
+
PromptAgentRole.WORKSPACE_CHAT.value,
|
|
159
|
+
PromptAgentRole.WORKSPACE_AGENT.value,
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
|
|
163
|
+
@staticmethod
|
|
164
|
+
def _get_prompt_runtime_role(prompt: Prompt) -> str:
|
|
165
|
+
runtime_policy = getattr(prompt, "runtime_policy", None)
|
|
166
|
+
if not isinstance(runtime_policy, dict):
|
|
167
|
+
runtime_policy = {}
|
|
168
|
+
role = str(runtime_policy.get("role") or "").strip().lower()
|
|
169
|
+
if role in {
|
|
170
|
+
PromptAgentRole.WORKSPACE_CHAT.value,
|
|
171
|
+
PromptAgentRole.WORKSPACE_AGENT.value,
|
|
172
|
+
PromptAgentRole.CHANNELS.value,
|
|
173
|
+
PromptAgentRole.OPERATIONS.value,
|
|
174
|
+
}:
|
|
175
|
+
return role
|
|
176
|
+
return PromptAgentRole.WORKSPACE_CHAT.value
|
|
160
177
|
|
|
161
178
|
def create_or_update_prompt(self, new_prompt: Prompt):
|
|
162
179
|
prompt = self.session.query(Prompt).filter_by(company_id=new_prompt.company_id,
|
|
@@ -167,16 +184,6 @@ class LLMQueryRepo:
|
|
|
167
184
|
prompt.order = new_prompt.order
|
|
168
185
|
if new_prompt.active is not None:
|
|
169
186
|
prompt.active = new_prompt.active
|
|
170
|
-
prompt.agent_role = (
|
|
171
|
-
getattr(new_prompt, "agent_role", None)
|
|
172
|
-
or prompt.agent_role
|
|
173
|
-
or PromptAgentRole.WORKSPACE_CHAT.value
|
|
174
|
-
)
|
|
175
|
-
prompt.execution_mode = (
|
|
176
|
-
PromptExecutionMode.CONVERSATIONAL.value
|
|
177
|
-
if prompt.agent_role == PromptAgentRole.WORKSPACE_CHAT.value
|
|
178
|
-
else PromptExecutionMode.AGENTIC.value
|
|
179
|
-
)
|
|
180
187
|
prompt.filename = new_prompt.filename
|
|
181
188
|
prompt.custom_fields = new_prompt.custom_fields
|
|
182
189
|
prompt.output_schema = new_prompt.output_schema
|
|
@@ -191,21 +198,15 @@ class LLMQueryRepo:
|
|
|
191
198
|
)
|
|
192
199
|
prompt.attachment_fallback = new_prompt.attachment_fallback or prompt.attachment_fallback or "extract"
|
|
193
200
|
prompt.llm_model = new_prompt.llm_model
|
|
194
|
-
prompt.queue_tier = getattr(new_prompt, "queue_tier", None) or prompt.queue_tier or "default"
|
|
195
201
|
prompt.llm_request_options = dict(new_prompt.llm_request_options or {})
|
|
196
202
|
prompt.tool_policy = dict(new_prompt.tool_policy or {})
|
|
197
|
-
prompt.
|
|
203
|
+
prompt.runtime_policy = (
|
|
204
|
+
dict(getattr(new_prompt, "runtime_policy", None) or {})
|
|
205
|
+
or dict(getattr(prompt, "runtime_policy", None) or {})
|
|
206
|
+
)
|
|
198
207
|
else:
|
|
199
208
|
if new_prompt.active is None:
|
|
200
209
|
new_prompt.active = True
|
|
201
|
-
if not new_prompt.agent_role:
|
|
202
|
-
new_prompt.agent_role = PromptAgentRole.WORKSPACE_CHAT.value
|
|
203
|
-
if not new_prompt.execution_mode:
|
|
204
|
-
new_prompt.execution_mode = (
|
|
205
|
-
PromptExecutionMode.CONVERSATIONAL.value
|
|
206
|
-
if new_prompt.agent_role == PromptAgentRole.WORKSPACE_CHAT.value
|
|
207
|
-
else PromptExecutionMode.AGENTIC.value
|
|
208
|
-
)
|
|
209
210
|
if not new_prompt.output_schema_mode:
|
|
210
211
|
new_prompt.output_schema_mode = "best_effort"
|
|
211
212
|
if not new_prompt.output_response_mode:
|
|
@@ -216,14 +217,12 @@ class LLMQueryRepo:
|
|
|
216
217
|
new_prompt.attachment_parser_provider = "basic"
|
|
217
218
|
if not new_prompt.attachment_fallback:
|
|
218
219
|
new_prompt.attachment_fallback = "extract"
|
|
219
|
-
if not getattr(new_prompt, "queue_tier", None):
|
|
220
|
-
new_prompt.queue_tier = "default"
|
|
221
220
|
if new_prompt.llm_request_options is None:
|
|
222
221
|
new_prompt.llm_request_options = {}
|
|
223
222
|
if new_prompt.tool_policy is None:
|
|
224
223
|
new_prompt.tool_policy = {}
|
|
225
|
-
if getattr(new_prompt, "
|
|
226
|
-
new_prompt.
|
|
224
|
+
if getattr(new_prompt, "runtime_policy", None) is None:
|
|
225
|
+
new_prompt.runtime_policy = {}
|
|
227
226
|
self.session.add(new_prompt)
|
|
228
227
|
prompt = new_prompt
|
|
229
228
|
|
|
@@ -724,8 +724,6 @@ class Prompt(Base):
|
|
|
724
724
|
description = Column(String, nullable=False)
|
|
725
725
|
filename = Column(String, nullable=False)
|
|
726
726
|
active = Column(Boolean, default=True)
|
|
727
|
-
agent_role = Column(String, default=PromptAgentRole.WORKSPACE_CHAT.value, nullable=False)
|
|
728
|
-
execution_mode = Column(String, default=PromptExecutionMode.CONVERSATIONAL.value, nullable=False)
|
|
729
727
|
order = Column(Integer, nullable=True, default=0)
|
|
730
728
|
category_id = Column(Integer, ForeignKey(f'{ORM_SCHEMA}.iat_prompt_categories.id', ondelete='SET NULL'), nullable=True)
|
|
731
729
|
custom_fields = Column(JSON, nullable=False, default=[])
|
|
@@ -737,10 +735,9 @@ class Prompt(Base):
|
|
|
737
735
|
attachment_parser_provider = Column(String, nullable=False, default="basic")
|
|
738
736
|
attachment_fallback = Column(String, nullable=False, default="extract")
|
|
739
737
|
llm_model = Column(String, nullable=True, default=None)
|
|
740
|
-
queue_tier = Column(String, nullable=False, default="default")
|
|
741
738
|
llm_request_options = Column(JSON_NATIVE, nullable=False, default=dict)
|
|
742
739
|
tool_policy = Column(JSON_NATIVE, nullable=False, default=dict)
|
|
743
|
-
|
|
740
|
+
runtime_policy = Column(JSON_NATIVE, nullable=False, default=dict)
|
|
744
741
|
created_at = Column(DateTime, default=datetime.now)
|
|
745
742
|
|
|
746
743
|
def to_dict(self):
|
|
@@ -755,6 +752,59 @@ class Prompt(Base):
|
|
|
755
752
|
order_by="PromptResourceBinding.binding_order",
|
|
756
753
|
)
|
|
757
754
|
|
|
755
|
+
def _runtime_policy_dict(self) -> dict:
|
|
756
|
+
return dict(self.runtime_policy or {})
|
|
757
|
+
|
|
758
|
+
def _set_runtime_policy_value(self, key: str, value):
|
|
759
|
+
policy = self._runtime_policy_dict()
|
|
760
|
+
policy["version"] = 1
|
|
761
|
+
policy[key] = value
|
|
762
|
+
self.runtime_policy = policy
|
|
763
|
+
|
|
764
|
+
@property
|
|
765
|
+
def agent_role(self) -> str:
|
|
766
|
+
role = str((self.runtime_policy or {}).get("role") or "").strip().lower()
|
|
767
|
+
if role in {item.value for item in PromptAgentRole}:
|
|
768
|
+
return role
|
|
769
|
+
return PromptAgentRole.WORKSPACE_CHAT.value
|
|
770
|
+
|
|
771
|
+
@agent_role.setter
|
|
772
|
+
def agent_role(self, value: str | None):
|
|
773
|
+
role = str(value or "").strip().lower()
|
|
774
|
+
if role not in {item.value for item in PromptAgentRole}:
|
|
775
|
+
role = PromptAgentRole.WORKSPACE_CHAT.value
|
|
776
|
+
self._set_runtime_policy_value("role", role)
|
|
777
|
+
|
|
778
|
+
@property
|
|
779
|
+
def execution_mode(self) -> str:
|
|
780
|
+
if self.agent_role == PromptAgentRole.WORKSPACE_CHAT.value:
|
|
781
|
+
return PromptExecutionMode.CONVERSATIONAL.value
|
|
782
|
+
return PromptExecutionMode.AGENTIC.value
|
|
783
|
+
|
|
784
|
+
@execution_mode.setter
|
|
785
|
+
def execution_mode(self, value: str | None):
|
|
786
|
+
# execution_mode is derived from runtime_policy.role and is intentionally not persisted.
|
|
787
|
+
return
|
|
788
|
+
|
|
789
|
+
@property
|
|
790
|
+
def queue_tier(self) -> str:
|
|
791
|
+
tier = str((self.runtime_policy or {}).get("queue_tier") or "default").strip().lower()
|
|
792
|
+
return "low" if tier == "low" else "default"
|
|
793
|
+
|
|
794
|
+
@queue_tier.setter
|
|
795
|
+
def queue_tier(self, value: str | None):
|
|
796
|
+
tier = str(value or "default").strip().lower()
|
|
797
|
+
self._set_runtime_policy_value("queue_tier", "low" if tier == "low" else "default")
|
|
798
|
+
|
|
799
|
+
@property
|
|
800
|
+
def context_policy(self) -> dict:
|
|
801
|
+
context = (self.runtime_policy or {}).get("context")
|
|
802
|
+
return dict(context or {}) if isinstance(context, dict) else {}
|
|
803
|
+
|
|
804
|
+
@context_policy.setter
|
|
805
|
+
def context_policy(self, value: dict | None):
|
|
806
|
+
self._set_runtime_policy_value("context", dict(value or {}))
|
|
807
|
+
|
|
758
808
|
|
|
759
809
|
class PromptResourceBinding(Base):
|
|
760
810
|
__tablename__ = "iat_prompt_resource_bindings"
|
|
@@ -777,13 +777,13 @@ class ConfigurationService:
|
|
|
777
777
|
prompt_list, categories_config = self._get_prompt_config(config)
|
|
778
778
|
|
|
779
779
|
category_set = set(categories_config)
|
|
780
|
-
allowed_execution_modes = {"conversational", "agentic"}
|
|
781
780
|
allowed_agent_roles = {
|
|
782
781
|
"workspace_chat",
|
|
783
782
|
"workspace_agent",
|
|
784
783
|
"channels",
|
|
785
784
|
"operations",
|
|
786
785
|
}
|
|
786
|
+
allowed_queue_tiers = {"default", "low"}
|
|
787
787
|
allowed_output_schema_modes = {"best_effort", "strict"}
|
|
788
788
|
allowed_output_response_modes = {"chat_compatible", "structured_only"}
|
|
789
789
|
allowed_attachment_modes = {"extracted_only", "native_only", "native_plus_extracted"}
|
|
@@ -816,19 +816,24 @@ class ConfigurationService:
|
|
|
816
816
|
add_error(f"prompts[{i}]", "Missing required key: 'description'")
|
|
817
817
|
|
|
818
818
|
prompt_cat = prompt.get("category")
|
|
819
|
-
|
|
820
|
-
if
|
|
819
|
+
runtime_policy = prompt.get("runtime_policy") or {}
|
|
820
|
+
if not isinstance(runtime_policy, dict):
|
|
821
|
+
add_error(f"prompts[{i}].runtime_policy", "Must be a dictionary.")
|
|
822
|
+
continue
|
|
823
|
+
|
|
824
|
+
agent_role = str(runtime_policy.get("role", "") or "").strip().lower()
|
|
825
|
+
if agent_role and agent_role not in allowed_agent_roles:
|
|
821
826
|
add_error(
|
|
822
|
-
f"prompts[{i}]",
|
|
823
|
-
f"Unsupported
|
|
827
|
+
f"prompts[{i}].runtime_policy.role",
|
|
828
|
+
f"Unsupported runtime_policy.role '{agent_role}'. Must be one of: {sorted(allowed_agent_roles)}.",
|
|
824
829
|
)
|
|
825
830
|
continue
|
|
826
831
|
|
|
827
|
-
|
|
828
|
-
if
|
|
832
|
+
queue_tier = str(runtime_policy.get("queue_tier", "") or "").strip().lower()
|
|
833
|
+
if queue_tier and queue_tier not in allowed_queue_tiers:
|
|
829
834
|
add_error(
|
|
830
|
-
f"prompts[{i}].
|
|
831
|
-
f"Unsupported
|
|
835
|
+
f"prompts[{i}].runtime_policy.queue_tier",
|
|
836
|
+
f"Unsupported runtime_policy.queue_tier '{queue_tier}'. Must be one of: {sorted(allowed_queue_tiers)}.",
|
|
832
837
|
)
|
|
833
838
|
continue
|
|
834
839
|
|
|
@@ -129,15 +129,17 @@ class ContextBuilderService:
|
|
|
129
129
|
except Exception:
|
|
130
130
|
schema = None
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
132
|
+
raw_runtime_policy = getattr(prompt_obj, "runtime_policy", None)
|
|
133
|
+
if isinstance(raw_runtime_policy, dict):
|
|
134
|
+
runtime_policy = PromptService.normalize_runtime_policy(raw_runtime_policy)
|
|
135
|
+
else:
|
|
136
|
+
runtime_policy = PromptService.normalize_runtime_policy({
|
|
137
|
+
"role": getattr(prompt_obj, "agent_role", None),
|
|
138
|
+
"queue_tier": getattr(prompt_obj, "queue_tier", None),
|
|
139
|
+
"context": getattr(prompt_obj, "context_policy", None),
|
|
140
|
+
})
|
|
141
|
+
agent_role = runtime_policy["role"]
|
|
142
|
+
execution_mode = PromptService.execution_mode_for_agent_role(agent_role)
|
|
141
143
|
|
|
142
144
|
resource_bindings: list[dict] = []
|
|
143
145
|
for binding in getattr(prompt_obj, "resource_bindings", []) or []:
|
|
@@ -163,10 +165,8 @@ class ContextBuilderService:
|
|
|
163
165
|
"prompt_name": prompt_obj.name,
|
|
164
166
|
"agent_role": agent_role,
|
|
165
167
|
"execution_mode": execution_mode,
|
|
166
|
-
"
|
|
167
|
-
|
|
168
|
-
agent_role,
|
|
169
|
-
),
|
|
168
|
+
"runtime_policy": runtime_policy,
|
|
169
|
+
"context_policy": runtime_policy["context"],
|
|
170
170
|
"schema": schema,
|
|
171
171
|
"schema_yaml": prompt_obj.output_schema_yaml,
|
|
172
172
|
"schema_mode": prompt_obj.output_schema_mode or "best_effort",
|
|
@@ -17,7 +17,6 @@ from iatoolkit.repositories.models import (
|
|
|
17
17
|
PromptAgentRole,
|
|
18
18
|
PromptCategory,
|
|
19
19
|
Company,
|
|
20
|
-
PromptExecutionMode,
|
|
21
20
|
)
|
|
22
21
|
from iatoolkit.common.exceptions import IAToolkitException
|
|
23
22
|
from iatoolkit.services.system_prompt_catalog import build_system_prompt_payload
|
|
@@ -49,8 +48,8 @@ class PromptService:
|
|
|
49
48
|
TOOL_POLICY_MODE_EXPLICIT = "explicit"
|
|
50
49
|
QUEUE_TIER_DEFAULT = "default"
|
|
51
50
|
QUEUE_TIER_LOW = "low"
|
|
52
|
-
EXECUTION_MODE_CONVERSATIONAL =
|
|
53
|
-
EXECUTION_MODE_AGENTIC =
|
|
51
|
+
EXECUTION_MODE_CONVERSATIONAL = "conversational"
|
|
52
|
+
EXECUTION_MODE_AGENTIC = "agentic"
|
|
54
53
|
AGENT_ROLE_WORKSPACE_CHAT = PromptAgentRole.WORKSPACE_CHAT.value
|
|
55
54
|
AGENT_ROLE_WORKSPACE_AGENT = PromptAgentRole.WORKSPACE_AGENT.value
|
|
56
55
|
AGENT_ROLE_CHANNELS = PromptAgentRole.CHANNELS.value
|
|
@@ -182,6 +181,54 @@ class PromptService:
|
|
|
182
181
|
blocks[key] = bool(raw_blocks.get(key))
|
|
183
182
|
return {"company_context_blocks": blocks}
|
|
184
183
|
|
|
184
|
+
@classmethod
|
|
185
|
+
def normalize_agent_role_value(cls, agent_role: str | None) -> str:
|
|
186
|
+
candidate = str(agent_role or "").strip().lower()
|
|
187
|
+
if candidate in {
|
|
188
|
+
cls.AGENT_ROLE_WORKSPACE_CHAT,
|
|
189
|
+
cls.AGENT_ROLE_WORKSPACE_AGENT,
|
|
190
|
+
cls.AGENT_ROLE_CHANNELS,
|
|
191
|
+
cls.AGENT_ROLE_OPERATIONS,
|
|
192
|
+
}:
|
|
193
|
+
return candidate
|
|
194
|
+
return cls.AGENT_ROLE_WORKSPACE_CHAT
|
|
195
|
+
|
|
196
|
+
@classmethod
|
|
197
|
+
def normalize_queue_tier_value(cls, queue_tier: str | None) -> str:
|
|
198
|
+
candidate = str(queue_tier or cls.QUEUE_TIER_DEFAULT).strip().lower()
|
|
199
|
+
if candidate in {cls.QUEUE_TIER_DEFAULT, cls.QUEUE_TIER_LOW}:
|
|
200
|
+
return candidate
|
|
201
|
+
return cls.QUEUE_TIER_DEFAULT
|
|
202
|
+
|
|
203
|
+
@classmethod
|
|
204
|
+
def normalize_runtime_policy(cls, runtime_policy: dict | None) -> dict:
|
|
205
|
+
policy = runtime_policy if isinstance(runtime_policy, dict) else {}
|
|
206
|
+
role = cls.normalize_agent_role_value(policy.get("role"))
|
|
207
|
+
queue_tier = cls.normalize_queue_tier_value(policy.get("queue_tier"))
|
|
208
|
+
raw_context = policy.get("context")
|
|
209
|
+
context = cls.normalize_context_policy(
|
|
210
|
+
raw_context if isinstance(raw_context, dict) else None,
|
|
211
|
+
role,
|
|
212
|
+
)
|
|
213
|
+
return {
|
|
214
|
+
"version": 1,
|
|
215
|
+
"role": role,
|
|
216
|
+
"queue_tier": queue_tier,
|
|
217
|
+
"context": context,
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@classmethod
|
|
221
|
+
def get_runtime_policy_role(cls, runtime_policy: dict | None) -> str:
|
|
222
|
+
return cls.normalize_runtime_policy(runtime_policy).get("role", cls.AGENT_ROLE_WORKSPACE_CHAT)
|
|
223
|
+
|
|
224
|
+
@classmethod
|
|
225
|
+
def get_runtime_policy_queue_tier(cls, runtime_policy: dict | None) -> str:
|
|
226
|
+
return cls.normalize_runtime_policy(runtime_policy).get("queue_tier", cls.QUEUE_TIER_DEFAULT)
|
|
227
|
+
|
|
228
|
+
@classmethod
|
|
229
|
+
def get_runtime_policy_context(cls, runtime_policy: dict | None) -> dict:
|
|
230
|
+
return cls.normalize_runtime_policy(runtime_policy).get("context", cls.default_context_policy_for_agent_role(None))
|
|
231
|
+
|
|
185
232
|
def _normalize_output_schema_mode(self, output_schema_mode: str | None) -> str:
|
|
186
233
|
candidate = str(output_schema_mode or self.OUTPUT_SCHEMA_MODE_BEST_EFFORT).strip().lower()
|
|
187
234
|
allowed = {
|
|
@@ -544,7 +591,9 @@ class PromptService:
|
|
|
544
591
|
all_prompts = [
|
|
545
592
|
prompt for prompt in all_prompts
|
|
546
593
|
if bool(getattr(prompt, 'active', True))
|
|
547
|
-
and self.is_workspace_chat_role(
|
|
594
|
+
and self.is_workspace_chat_role(
|
|
595
|
+
self.get_runtime_policy_role(getattr(prompt, 'runtime_policy', None))
|
|
596
|
+
)
|
|
548
597
|
]
|
|
549
598
|
|
|
550
599
|
# group by category
|
|
@@ -567,43 +616,35 @@ class PromptService:
|
|
|
567
616
|
sorted_categories = sorted(prompts_by_category.items(), key=lambda item: item[0][0])
|
|
568
617
|
|
|
569
618
|
for (cat_order, cat_name), prompts in sorted_categories:
|
|
619
|
+
prompt_items = []
|
|
620
|
+
for p in prompts:
|
|
621
|
+
runtime_policy = self.normalize_runtime_policy(getattr(p, 'runtime_policy', None))
|
|
622
|
+
agent_role = runtime_policy["role"]
|
|
623
|
+
prompt_items.append({
|
|
624
|
+
'prompt': p.name,
|
|
625
|
+
'description': p.description,
|
|
626
|
+
'category': p.category.name if p.category else None,
|
|
627
|
+
'agent_role': agent_role,
|
|
628
|
+
'execution_mode': self.execution_mode_for_agent_role(agent_role),
|
|
629
|
+
'active': p.active,
|
|
630
|
+
'custom_fields': p.custom_fields,
|
|
631
|
+
'order': p.order,
|
|
632
|
+
'output_schema_mode': p.output_schema_mode,
|
|
633
|
+
'output_response_mode': p.output_response_mode,
|
|
634
|
+
'attachment_mode': p.attachment_mode,
|
|
635
|
+
'attachment_parser_provider': getattr(p, 'attachment_parser_provider', None),
|
|
636
|
+
'attachment_fallback': p.attachment_fallback,
|
|
637
|
+
'llm_model': getattr(p, 'llm_model', None),
|
|
638
|
+
'queue_tier': runtime_policy["queue_tier"],
|
|
639
|
+
'llm_request_options': dict(getattr(p, 'llm_request_options', None) or {}),
|
|
640
|
+
'tool_policy': dict(getattr(p, 'tool_policy', None) or {}),
|
|
641
|
+
'context_policy': runtime_policy["context"],
|
|
642
|
+
})
|
|
643
|
+
|
|
570
644
|
categorized_prompts.append({
|
|
571
645
|
'category_name': cat_name,
|
|
572
646
|
'category_order': cat_order,
|
|
573
|
-
'prompts':
|
|
574
|
-
{
|
|
575
|
-
'prompt': p.name,
|
|
576
|
-
'description': p.description,
|
|
577
|
-
'category': p.category.name if p.category else None,
|
|
578
|
-
'agent_role': self._normalize_agent_role(
|
|
579
|
-
getattr(p, 'agent_role', None)
|
|
580
|
-
),
|
|
581
|
-
'execution_mode': (
|
|
582
|
-
str(getattr(p, 'execution_mode', None) or self.EXECUTION_MODE_CONVERSATIONAL)
|
|
583
|
-
.strip()
|
|
584
|
-
.lower()
|
|
585
|
-
),
|
|
586
|
-
'active': p.active,
|
|
587
|
-
'custom_fields': p.custom_fields,
|
|
588
|
-
'order': p.order,
|
|
589
|
-
'output_schema_mode': p.output_schema_mode,
|
|
590
|
-
'output_response_mode': p.output_response_mode,
|
|
591
|
-
'attachment_mode': p.attachment_mode,
|
|
592
|
-
'attachment_parser_provider': getattr(p, 'attachment_parser_provider', None),
|
|
593
|
-
'attachment_fallback': p.attachment_fallback,
|
|
594
|
-
'llm_model': getattr(p, 'llm_model', None),
|
|
595
|
-
'queue_tier': self._normalize_queue_tier(
|
|
596
|
-
getattr(p, 'queue_tier', None)
|
|
597
|
-
),
|
|
598
|
-
'llm_request_options': dict(getattr(p, 'llm_request_options', None) or {}),
|
|
599
|
-
'tool_policy': dict(getattr(p, 'tool_policy', None) or {}),
|
|
600
|
-
'context_policy': self.normalize_context_policy(
|
|
601
|
-
getattr(p, 'context_policy', None),
|
|
602
|
-
getattr(p, 'agent_role', None),
|
|
603
|
-
),
|
|
604
|
-
}
|
|
605
|
-
for p in prompts
|
|
606
|
-
]
|
|
647
|
+
'prompts': prompt_items
|
|
607
648
|
})
|
|
608
649
|
|
|
609
650
|
return {'message': categorized_prompts}
|
|
@@ -686,10 +727,43 @@ class PromptService:
|
|
|
686
727
|
tool_policy = self._normalize_tool_policy(data.get("tool_policy"))
|
|
687
728
|
|
|
688
729
|
# 2. update the prompt in the database
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
730
|
+
raw_runtime_policy = data.get("runtime_policy")
|
|
731
|
+
runtime_policy_explicit = isinstance(raw_runtime_policy, dict)
|
|
732
|
+
if runtime_policy_explicit:
|
|
733
|
+
runtime_policy = self.normalize_runtime_policy(raw_runtime_policy)
|
|
734
|
+
else:
|
|
735
|
+
existing_runtime_policy = self.normalize_runtime_policy(
|
|
736
|
+
getattr(existing_prompt, "runtime_policy", None)
|
|
737
|
+
if existing_prompt is not None else None
|
|
738
|
+
)
|
|
739
|
+
role_value = data.get(
|
|
740
|
+
"agent_role",
|
|
741
|
+
getattr(existing_prompt, "agent_role", existing_runtime_policy["role"])
|
|
742
|
+
if existing_prompt is not None else existing_runtime_policy["role"],
|
|
743
|
+
)
|
|
744
|
+
queue_tier_value = data.get(
|
|
745
|
+
"queue_tier",
|
|
746
|
+
getattr(existing_prompt, "queue_tier", existing_runtime_policy["queue_tier"])
|
|
747
|
+
if existing_prompt is not None else existing_runtime_policy["queue_tier"],
|
|
748
|
+
)
|
|
749
|
+
if "context_policy" in data:
|
|
750
|
+
context_value = data.get("context_policy")
|
|
751
|
+
elif "agent_role" in data:
|
|
752
|
+
context_value = None
|
|
753
|
+
else:
|
|
754
|
+
context_value = (
|
|
755
|
+
getattr(existing_prompt, "context_policy", existing_runtime_policy["context"])
|
|
756
|
+
if existing_prompt is not None else existing_runtime_policy["context"]
|
|
757
|
+
)
|
|
758
|
+
runtime_policy = self.normalize_runtime_policy({
|
|
759
|
+
"role": role_value,
|
|
760
|
+
"queue_tier": queue_tier_value,
|
|
761
|
+
"context": context_value,
|
|
762
|
+
})
|
|
763
|
+
agent_role = runtime_policy["role"]
|
|
764
|
+
force_free_text_output = (
|
|
765
|
+
runtime_policy_explicit or "agent_role" in data
|
|
766
|
+
) and self.should_force_free_text_output(agent_role)
|
|
693
767
|
|
|
694
768
|
new_prompt = Prompt(
|
|
695
769
|
company_id=company.id,
|
|
@@ -698,8 +772,6 @@ class PromptService:
|
|
|
698
772
|
order=data.get('order', 1),
|
|
699
773
|
category_id=category_id,
|
|
700
774
|
active=data.get('active', True),
|
|
701
|
-
agent_role=agent_role,
|
|
702
|
-
execution_mode=execution_mode,
|
|
703
775
|
filename=f"{prompt_name.lower().replace(' ', '_')}.prompt",
|
|
704
776
|
custom_fields=data.get('custom_fields', []),
|
|
705
777
|
output_schema=None if force_free_text_output else output_schema,
|
|
@@ -724,17 +796,9 @@ class PromptService:
|
|
|
724
796
|
data.get("attachment_fallback", company_default_policy["attachment_fallback"])
|
|
725
797
|
),
|
|
726
798
|
llm_model=self._normalize_llm_model(company_short_name, data.get("llm_model")),
|
|
727
|
-
queue_tier=self._normalize_queue_tier(
|
|
728
|
-
data.get("queue_tier")
|
|
729
|
-
if "queue_tier" in data
|
|
730
|
-
else getattr(existing_prompt, "queue_tier", None)
|
|
731
|
-
),
|
|
732
799
|
llm_request_options=llm_request_options,
|
|
733
800
|
tool_policy=tool_policy,
|
|
734
|
-
|
|
735
|
-
data.get("context_policy"),
|
|
736
|
-
agent_role,
|
|
737
|
-
),
|
|
801
|
+
runtime_policy=runtime_policy,
|
|
738
802
|
)
|
|
739
803
|
self.llm_query_repo.create_or_update_prompt(new_prompt)
|
|
740
804
|
|
|
@@ -966,9 +1030,9 @@ class PromptService:
|
|
|
966
1030
|
filename = f"{prompt_name}.prompt"
|
|
967
1031
|
normalized_schema = StructuredOutputService.normalize_schema(prompt_data.get("output_schema"))
|
|
968
1032
|
|
|
969
|
-
|
|
970
|
-
agent_role =
|
|
971
|
-
force_free_text_output =
|
|
1033
|
+
runtime_policy = self.normalize_runtime_policy(prompt_data.get("runtime_policy"))
|
|
1034
|
+
agent_role = runtime_policy["role"]
|
|
1035
|
+
force_free_text_output = self.should_force_free_text_output(agent_role)
|
|
972
1036
|
new_prompt = Prompt(
|
|
973
1037
|
company_id=company.id,
|
|
974
1038
|
name=prompt_name,
|
|
@@ -976,8 +1040,6 @@ class PromptService:
|
|
|
976
1040
|
order=prompt_data.get('order'),
|
|
977
1041
|
category_id=category_obj.id if category_obj else None,
|
|
978
1042
|
active=prompt_data.get('active', True),
|
|
979
|
-
agent_role=agent_role,
|
|
980
|
-
execution_mode=self.execution_mode_for_agent_role(agent_role),
|
|
981
1043
|
filename=filename,
|
|
982
1044
|
custom_fields=prompt_data.get('custom_fields', []),
|
|
983
1045
|
output_schema=None if force_free_text_output else normalized_schema,
|
|
@@ -1006,15 +1068,11 @@ class PromptService:
|
|
|
1006
1068
|
prompt_data.get("attachment_fallback", company_default_policy["attachment_fallback"])
|
|
1007
1069
|
),
|
|
1008
1070
|
llm_model=self._normalize_llm_model(company_short_name, prompt_data.get("llm_model")),
|
|
1009
|
-
queue_tier=self._normalize_queue_tier(prompt_data.get("queue_tier")),
|
|
1010
1071
|
llm_request_options=self._normalize_llm_request_options(
|
|
1011
1072
|
self._extract_llm_request_options_payload(prompt_data)
|
|
1012
1073
|
),
|
|
1013
1074
|
tool_policy=self._normalize_tool_policy(prompt_data.get("tool_policy")),
|
|
1014
|
-
|
|
1015
|
-
prompt_data.get("context_policy"),
|
|
1016
|
-
agent_role,
|
|
1017
|
-
),
|
|
1075
|
+
runtime_policy=runtime_policy,
|
|
1018
1076
|
)
|
|
1019
1077
|
|
|
1020
1078
|
self.llm_query_repo.create_or_update_prompt(new_prompt)
|
|
@@ -273,26 +273,22 @@ class QueryService:
|
|
|
273
273
|
contract["attachment_mode"] = (
|
|
274
274
|
str(raw_attachment_mode).strip().lower() if raw_attachment_mode is not None else None
|
|
275
275
|
)
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
if normalized_agent_role not in {"workspace_chat", "workspace_agent", "channels", "operations"}:
|
|
290
|
-
normalized_agent_role = "workspace_chat"
|
|
276
|
+
raw_runtime_policy = contract.get("runtime_policy")
|
|
277
|
+
if isinstance(raw_runtime_policy, dict):
|
|
278
|
+
runtime_policy = PromptService.normalize_runtime_policy(raw_runtime_policy)
|
|
279
|
+
runtime_role_explicit = True
|
|
280
|
+
else:
|
|
281
|
+
runtime_policy = PromptService.normalize_runtime_policy({
|
|
282
|
+
"role": contract.get("agent_role"),
|
|
283
|
+
"queue_tier": contract.get("queue_tier"),
|
|
284
|
+
"context": contract.get("context_policy"),
|
|
285
|
+
})
|
|
286
|
+
runtime_role_explicit = contract.get("agent_role") is not None
|
|
287
|
+
normalized_agent_role = runtime_policy["role"]
|
|
288
|
+
contract["runtime_policy"] = runtime_policy
|
|
291
289
|
contract["agent_role"] = normalized_agent_role
|
|
292
|
-
contract["execution_mode"] = (
|
|
293
|
-
|
|
294
|
-
)
|
|
295
|
-
if raw_agent_role is not None and normalized_agent_role in {"workspace_chat", "channels"}:
|
|
290
|
+
contract["execution_mode"] = PromptService.execution_mode_for_agent_role(normalized_agent_role)
|
|
291
|
+
if runtime_role_explicit and normalized_agent_role in {"workspace_chat", "channels"}:
|
|
296
292
|
contract["response_mode"] = "chat_compatible"
|
|
297
293
|
contract["schema"] = None
|
|
298
294
|
contract["schema_mode"] = "best_effort"
|
|
@@ -342,10 +338,7 @@ class QueryService:
|
|
|
342
338
|
})
|
|
343
339
|
contract["resource_bindings"] = normalized_resource_bindings
|
|
344
340
|
contract["tool_policy"] = self._normalize_prompt_tool_policy(contract.get("tool_policy"))
|
|
345
|
-
contract["context_policy"] =
|
|
346
|
-
contract.get("context_policy"),
|
|
347
|
-
contract.get("agent_role"),
|
|
348
|
-
)
|
|
341
|
+
contract["context_policy"] = runtime_policy["context"]
|
|
349
342
|
contract["provider"] = self._get_provider(company.short_name, contract.get("llm_model") or "")
|
|
350
343
|
return contract
|
|
351
344
|
except Exception as e:
|
|
@@ -48,9 +48,17 @@ class PromptApiView(MethodView):
|
|
|
48
48
|
|
|
49
49
|
# get the prompt content
|
|
50
50
|
content = self.prompt_service.get_prompt_content(company, prompt_name)
|
|
51
|
+
meta = prompt_obj.to_dict()
|
|
52
|
+
runtime_policy = PromptService.normalize_runtime_policy(meta.get("runtime_policy"))
|
|
53
|
+
agent_role = runtime_policy["role"]
|
|
54
|
+
meta["runtime_policy"] = runtime_policy
|
|
55
|
+
meta["agent_role"] = agent_role
|
|
56
|
+
meta["execution_mode"] = PromptService.execution_mode_for_agent_role(agent_role)
|
|
57
|
+
meta["queue_tier"] = runtime_policy["queue_tier"]
|
|
58
|
+
meta["context_policy"] = runtime_policy["context"]
|
|
51
59
|
|
|
52
60
|
return jsonify({
|
|
53
|
-
"meta":
|
|
61
|
+
"meta": meta,
|
|
54
62
|
"content": content
|
|
55
63
|
})
|
|
56
64
|
else:
|
|
File without changes
|