iatoolkit 2.42.0__tar.gz → 2.43.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.42.0/src/iatoolkit.egg-info → iatoolkit-2.43.0}/PKG-INFO +1 -1
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/__init__.py +1 -1
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/model_registry.py +22 -5
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/inference_embeddings_client.py +16 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/inference_handler.py +25 -5
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/jina_embeddings_client.py +17 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_providers/openai_compatible_chat_adapter.py +15 -1
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_proxy.py +22 -2
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/locales/en.yaml +25 -2
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/locales/es.yaml +25 -2
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/llm_query_repo.py +6 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/embedding_service.py +155 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/prompt_service.py +31 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/query_service.py +0 -1
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/tenant_wiki_service.py +214 -42
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/tool_service.py +46 -5
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/prompt_api_view.py +23 -3
- {iatoolkit-2.42.0 → iatoolkit-2.43.0/src/iatoolkit.egg-info}/PKG-INFO +1 -1
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/LICENSE +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/LICENSE_COMMUNITY.md +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/pyproject.toml +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/readme.md +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/requirements.txt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/setup.cfg +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/base_company.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/cli_commands.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/bridge_validation.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/exceptions.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/interfaces/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/interfaces/asset_storage.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/interfaces/database_provider.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/interfaces/memory_compilation_trigger.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/interfaces/memory_lint_trigger.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/interfaces/secret_provider.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/interfaces/signup_policy_resolver.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/interfaces/web_search_provider.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/routes.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/secret_resolver.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/session_manager.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/common/util.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/company_registry.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/llm_capabilities.yaml +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/channel_business_identity.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/channel_conversation_continuity.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/channel_response_style.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/chat_state_rules.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/chat_user_profile.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/core_identity.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/email_output.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/file_download_output.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/format_styles.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/html_structures.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/links_documents.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/memory_usage.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/multimodal_basics.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/output_basics.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/presentation_formatting.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/query_main.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/sql_aggregation_scope.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/sql_casting.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/sql_core.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/sql_jsonb.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/sql_mysql_casting.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/sql_mysql_json.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/sql_redshift_basics.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/sql_redshift_types.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/sql_rules.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts/tool_html_passthrough.prompt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_prompts_pack.yaml +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/config/system_tools_pack.yaml +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/core.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/brevo_mail_app.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/call_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/connectors/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/connectors/file_connector.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/connectors/file_connector_factory.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/connectors/google_cloud_storage_connector.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/connectors/google_drive_connector.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/connectors/local_file_connector.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/connectors/s3_connector.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/google_auth_client.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/google_chat_app.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_gateway_resolver.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_providers/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_providers/anthropic_adapter.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_providers/deepseek_adapter.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_providers/gemini_adapter.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_providers/openai_adapter.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_providers/openrouter_adapter.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/llm_response.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/infra/redis_session_manager.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/api_key_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/bridge_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/database_manager.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/document_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/env_secret_provider.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/filesystem_asset_repository.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/knowledge_wiki_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/mcp_token_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/memory_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/models.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/profile_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/prompt_resource_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/sql_dataset_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/sql_source_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/repositories/vs_repo.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/runtime_logging.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/api_key_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/attachment_policy_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/auth_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/benchmark_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/branding_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/company_context_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/configuration_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/context_builder_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/dispatcher_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/excel_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/file_processor_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/history_manager_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/http_tool_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/i18n_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/inference_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/jwt_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/knowledge_base_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/language_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/license_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/llm_client_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/mail_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/markdown_wiki_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/mcp_token_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/memory_compiler_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/memory_lint_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/memory_lookup_policy_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/memory_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/memory_wiki_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/noop_memory_compilation_trigger.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/noop_memory_lint_trigger.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/contracts.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/image_normalizer.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/parsing_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/pdf_ocr_detection.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/provider_factory.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/provider_resolver.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/providers/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/providers/basic_provider.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/providers/docling_provider.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/parsers/validator.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/pdf_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/profile_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/prompt_resource_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/signup_policy_resolver.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/sql_dataset_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/sql_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/sql_source_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/storage_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/structured_output_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/system_prompt_catalog.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/system_tools.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/telemetry_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/tool_output_contract.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/user_feedback_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/user_session_context_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/visual_kb_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/visual_tool_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/warmup_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/web_search/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/web_search/provider_factory.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/web_search/providers/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/web_search/providers/brave_provider.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/services/web_search_service.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/images/fernando.jpeg +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/images/iatoolkit_core.png +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/images/iatoolkit_logo.png +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_feedback_button.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_filepond.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_help_content.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_history_button.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_logout_button.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_main.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_memory_button.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_model_selector.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_onboarding_button.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_prompt_manager.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/js/chat_reload_button.js +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/styles/chat_iatoolkit.css +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/styles/chat_modal.css +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/styles/chat_public.css +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/styles/documents.css +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/styles/landing_page.css +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/styles/llm_output.css +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/static/styles/onboarding.css +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/_company_header.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/_login_widget.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/account.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/base.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/change_password.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/chat.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/chat_memory_modal.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/chat_modals.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/error.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/forgot_password.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/home_hosted_default.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/memory/wiki_schema.md +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/onboarding_shell.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/pdf/base.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/pdf/letter.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/pdf/report.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/pdf/simple.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/templates/signup.html +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/__init__.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/account_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/api_key_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/base_login_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/categories_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/change_password_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/chat_context_preview_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/chat_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/configuration_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/connectors_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/embedding_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/forgot_password_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/help_content_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/history_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/home_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/init_context_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/llmquery_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/load_document_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/login_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/logout_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/memory_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/profile_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/prompt_context_preview_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/prompt_resource_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/rag_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/root_redirect_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/signup_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/static_page_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/tool_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/user_feedback_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/users_api_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit/views/verify_user_view.py +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit.egg-info/SOURCES.txt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit.egg-info/dependency_links.txt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit.egg-info/requires.txt +0 -0
- {iatoolkit-2.42.0 → iatoolkit-2.43.0}/src/iatoolkit.egg-info/top_level.txt +0 -0
|
@@ -60,6 +60,10 @@ class RouteParam:
|
|
|
60
60
|
is_env_name: bool = False
|
|
61
61
|
#: A regular expression the value must match, or None for "any non-empty".
|
|
62
62
|
pattern: str | None = None
|
|
63
|
+
#: How to finish "'base_url' does not look like ___" when the pattern refuses a
|
|
64
|
+
#: value. Declared here so a new parameter cannot inherit another one's wording:
|
|
65
|
+
#: the message for `model_name` read "does not look like a URL".
|
|
66
|
+
looks_like: str = "a valid value"
|
|
63
67
|
|
|
64
68
|
|
|
65
69
|
#: What each provider needs in order to be reached, keyed by provider.
|
|
@@ -81,14 +85,23 @@ class RouteParam:
|
|
|
81
85
|
#: `openrouter` allows both and requires neither: there is one OpenRouter for
|
|
82
86
|
#: everyone and its base URL has a working default, so an entry only overrides
|
|
83
87
|
#: when it has a reason to.
|
|
88
|
+
#: `model_name` is optional and exists because a catalogue key is lowercased: it
|
|
89
|
+
#: identifies the model across entitlements, rate cards and usage rows, so it cannot
|
|
90
|
+
#: also be the name on the wire. A vLLM endpoint serving
|
|
91
|
+
#: `meta-llama/Llama-3.1-8B-Instruct` answers 404 to the lowercased key. When set,
|
|
92
|
+
#: it is the exact name that endpoint answers to, and only the wire value changes.
|
|
84
93
|
PROVIDER_ROUTE_PARAMS: dict[str, tuple[RouteParam, ...]] = {
|
|
85
94
|
"openai_compatible": (
|
|
86
|
-
RouteParam("base_url", required=True, pattern=r"^https?://\S+$"),
|
|
87
|
-
RouteParam("api_key_env", required=True, is_env_name=True, pattern=r"^[A-Z][A-Z0-9_]*$"
|
|
95
|
+
RouteParam("base_url", required=True, pattern=r"^https?://\S+$", looks_like="a URL"),
|
|
96
|
+
RouteParam("api_key_env", required=True, is_env_name=True, pattern=r"^[A-Z][A-Z0-9_]*$",
|
|
97
|
+
looks_like="an environment variable name"),
|
|
98
|
+
RouteParam("model_name", required=False, pattern=r"^[A-Za-z0-9._:\-/]+$",
|
|
99
|
+
looks_like="a model name"),
|
|
88
100
|
),
|
|
89
101
|
"openrouter": (
|
|
90
|
-
RouteParam("base_url", required=False, pattern=r"^https?://\S+$"),
|
|
91
|
-
RouteParam("api_key_env", required=False, is_env_name=True, pattern=r"^[A-Z][A-Z0-9_]*$"
|
|
102
|
+
RouteParam("base_url", required=False, pattern=r"^https?://\S+$", looks_like="a URL"),
|
|
103
|
+
RouteParam("api_key_env", required=False, is_env_name=True, pattern=r"^[A-Z][A-Z0-9_]*$",
|
|
104
|
+
looks_like="an environment variable name"),
|
|
92
105
|
),
|
|
93
106
|
}
|
|
94
107
|
|
|
@@ -163,12 +176,16 @@ class ModelRegistry:
|
|
|
163
176
|
|
|
164
177
|
def get_capabilities(self, model: str, provider: str | None = None) -> dict:
|
|
165
178
|
normalized_provider = self.normalize_provider(provider=provider, model=model)
|
|
179
|
+
# `openai_compatible` is absent on purpose. Its adapter targets any server
|
|
180
|
+
# that speaks chat.completions — llama.cpp, vLLM, a private gateway — and
|
|
181
|
+
# forwards no reasoning field, because one the server does not know earns a
|
|
182
|
+
# 400. Claiming the capability here made the tenant's Models page offer a
|
|
183
|
+
# reasoning control whose value went nowhere.
|
|
166
184
|
supports_reasoning_effort = normalized_provider in {
|
|
167
185
|
"openai",
|
|
168
186
|
"xai",
|
|
169
187
|
"openrouter",
|
|
170
188
|
"deepseek",
|
|
171
|
-
"openai_compatible",
|
|
172
189
|
}
|
|
173
190
|
supports_text_verbosity = normalized_provider in {"openai", "xai", "openrouter"}
|
|
174
191
|
supports_store = normalized_provider in {"openai", "xai"}
|
|
@@ -37,5 +37,21 @@ class InferenceEmbeddingsClient:
|
|
|
37
37
|
except Exception as e:
|
|
38
38
|
raise RuntimeError(f"Error generando embedding con InferenceClient: {e}")
|
|
39
39
|
|
|
40
|
+
def get_embeddings(self, texts: List[str]) -> List[List[float]]:
|
|
41
|
+
"""Embed a batch in one call. feature_extraction accepts a list and
|
|
42
|
+
returns one row per input; the single-text path already handled that shape."""
|
|
43
|
+
try:
|
|
44
|
+
embeddings = self.client.feature_extraction(list(texts))
|
|
45
|
+
if hasattr(embeddings, "tolist"):
|
|
46
|
+
embeddings = embeddings.tolist()
|
|
47
|
+
if not isinstance(embeddings, list) or len(embeddings) != len(texts):
|
|
48
|
+
raise RuntimeError(
|
|
49
|
+
f"feature_extraction returned {len(embeddings) if isinstance(embeddings, list) else 'no'} "
|
|
50
|
+
f"rows for {len(texts)} inputs."
|
|
51
|
+
)
|
|
52
|
+
return embeddings
|
|
53
|
+
except Exception as e:
|
|
54
|
+
raise RuntimeError(f"Error generando embeddings en lote con InferenceClient: {e}")
|
|
55
|
+
|
|
40
56
|
def get_image_embedding(self, presigned_url: Optional[str] = None, image_bytes: Optional[bytes] = None) -> List[float]:
|
|
41
57
|
raise NotImplementedError("Image embedding not implemented for this client.")
|
|
@@ -192,12 +192,29 @@ class EndpointHandler:
|
|
|
192
192
|
return {"embedding": vec}
|
|
193
193
|
|
|
194
194
|
def _handle_text_embedding(self, inputs: dict) -> dict:
|
|
195
|
-
text
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
"""Embed one text or a batch, in the order received.
|
|
196
|
+
|
|
197
|
+
``inputs.text`` (str) returns ``{"embedding": [...]}`` and ``inputs.texts``
|
|
198
|
+
(list) returns ``{"embeddings": [[...], ...]}``. Both shapes are answered so
|
|
199
|
+
an endpoint running this handler stays compatible with callers that predate
|
|
200
|
+
batching. The pooling below was already batch-shaped — it computed (B, D) and
|
|
201
|
+
returned row 0 — so the batch path is the same maths without the slice.
|
|
202
|
+
"""
|
|
203
|
+
texts = inputs.get("texts")
|
|
204
|
+
batched = texts is not None
|
|
205
|
+
if batched:
|
|
206
|
+
if not isinstance(texts, list) or not texts:
|
|
207
|
+
raise ValueError("Expected inputs.texts to be a non-empty list of strings.")
|
|
208
|
+
if any(not isinstance(item, str) or not item.strip() for item in texts):
|
|
209
|
+
raise ValueError("Every entry in inputs.texts must be a non-empty string.")
|
|
210
|
+
else:
|
|
211
|
+
text = inputs.get("text")
|
|
212
|
+
if not isinstance(text, str) or not text.strip():
|
|
213
|
+
raise ValueError("Expected inputs.text for text embedding generation.")
|
|
214
|
+
texts = [text]
|
|
198
215
|
|
|
199
216
|
encoded_input = self.processor_instance(
|
|
200
|
-
|
|
217
|
+
texts,
|
|
201
218
|
padding=True,
|
|
202
219
|
truncation=True,
|
|
203
220
|
return_tensors='pt'
|
|
@@ -213,7 +230,10 @@ class EndpointHandler:
|
|
|
213
230
|
min=1e-9
|
|
214
231
|
)
|
|
215
232
|
sentence_embeddings = torch.nn.functional.normalize(sentence_embeddings, p=2, dim=1)
|
|
216
|
-
|
|
233
|
+
vectors = sentence_embeddings.cpu().tolist()
|
|
234
|
+
if batched:
|
|
235
|
+
return {"embeddings": vectors}
|
|
236
|
+
return {"embedding": vectors[0]}
|
|
217
237
|
|
|
218
238
|
# Backward-compatible alias: existing tests/callers may still refer to _handle_minilm
|
|
219
239
|
def _handle_minilm(self, inputs: dict) -> dict:
|
|
@@ -36,6 +36,23 @@ class JinaEmbeddingsClient:
|
|
|
36
36
|
response = self._post(payload)
|
|
37
37
|
return response["data"][0]["embedding"]
|
|
38
38
|
|
|
39
|
+
def get_embeddings(self, texts: List[str]) -> List[List[float]]:
|
|
40
|
+
"""Embed a batch in one request. The API already took a list; this uses it."""
|
|
41
|
+
payload = {
|
|
42
|
+
"model": self.model,
|
|
43
|
+
"normalized": self.normalized,
|
|
44
|
+
"embedding_type": "float",
|
|
45
|
+
"input": list(texts),
|
|
46
|
+
}
|
|
47
|
+
response = self._post(payload)
|
|
48
|
+
data = response["data"]
|
|
49
|
+
if len(data) != len(texts):
|
|
50
|
+
raise ValueError(f"Jina returned {len(data)} embeddings for {len(texts)} inputs.")
|
|
51
|
+
# Sort by the API's own index rather than trusting arrival order: a silent
|
|
52
|
+
# reordering would attach each vector to the wrong text.
|
|
53
|
+
ordered = sorted(data, key=lambda item: item.get("index", 0))
|
|
54
|
+
return [item["embedding"] for item in ordered]
|
|
55
|
+
|
|
39
56
|
def get_image_embedding(self,
|
|
40
57
|
presigned_url: Optional[str] = None,
|
|
41
58
|
image_bytes: Optional[bytes] = None
|
|
@@ -22,7 +22,21 @@ class OpenAICompatibleChatAdapter:
|
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
24
|
supports_multimodal = False
|
|
25
|
-
|
|
25
|
+
#: `reasoning` is a **Responses API** parameter. This class calls
|
|
26
|
+
#: `chat.completions.create`, whose signature has no such argument, so the
|
|
27
|
+
#: OpenAI SDK raises a TypeError before any request leaves the process:
|
|
28
|
+
#: "Completions.create() got an unexpected keyword argument 'reasoning'".
|
|
29
|
+
#:
|
|
30
|
+
#: It was True here, and both subclasses overrode it to False — DeepSeek and
|
|
31
|
+
#: OpenRouter each had to correct the base. Nothing was served by this class
|
|
32
|
+
#: directly until a model with provider `openai_compatible` was added from the
|
|
33
|
+
#: catalogue, and that first request crashed.
|
|
34
|
+
supports_reasoning = False
|
|
35
|
+
#: The Chat Completions equivalent is the plain string `reasoning_effort`, and
|
|
36
|
+
#: it stays off *here*: this class targets any OpenAI-compatible server —
|
|
37
|
+
#: llama.cpp, vLLM, a private gateway — and a server that does not know the
|
|
38
|
+
#: field answers 400. A provider whose API does accept it opts in, which is
|
|
39
|
+
#: what DeepseekAdapter does.
|
|
26
40
|
supports_reasoning_effort = False
|
|
27
41
|
supports_reasoning_content_messages = False
|
|
28
42
|
supports_metadata = False
|
|
@@ -142,7 +142,11 @@ class LLMProxy:
|
|
|
142
142
|
request_kwargs["telemetry_execution"] = telemetry_execution
|
|
143
143
|
|
|
144
144
|
# Delegate to the adapter (OpenAI, Gemini, DeepSeek, xAI, Anthropic, etc.)
|
|
145
|
-
return adapter.create_response(
|
|
145
|
+
return adapter.create_response(
|
|
146
|
+
model=self._wire_model(model, model_config),
|
|
147
|
+
input=input,
|
|
148
|
+
**request_kwargs,
|
|
149
|
+
)
|
|
146
150
|
|
|
147
151
|
def describe_transport(self, company_short_name: str, model: str) -> str:
|
|
148
152
|
provider = self._resolve_provider_for_company_model(
|
|
@@ -349,7 +353,6 @@ class LLMProxy:
|
|
|
349
353
|
self.PROVIDER_OPENAI,
|
|
350
354
|
self.PROVIDER_XAI,
|
|
351
355
|
self.PROVIDER_DEEPSEEK,
|
|
352
|
-
self.PROVIDER_OPENAI_COMPATIBLE,
|
|
353
356
|
self.PROVIDER_OPENROUTER,
|
|
354
357
|
})
|
|
355
358
|
)
|
|
@@ -746,6 +749,23 @@ class LLMProxy:
|
|
|
746
749
|
route = (model_config or {}).get("route_config") if isinstance(model_config, dict) else None
|
|
747
750
|
return dict(route) if isinstance(route, dict) else {}
|
|
748
751
|
|
|
752
|
+
@staticmethod
|
|
753
|
+
def _wire_model(model: str, model_config: Dict[str, Any] | None) -> str:
|
|
754
|
+
"""The name the endpoint itself answers to, which is not always our key.
|
|
755
|
+
|
|
756
|
+
Catalogue keys are lowercased on write, because one key identifies a model
|
|
757
|
+
across entitlements, rate cards and usage rows. A server is free to be
|
|
758
|
+
case-sensitive: a vLLM endpoint serving `meta-llama/Llama-3.1-8B-Instruct`
|
|
759
|
+
answers `404 - The model does not exist` to the lowercased key.
|
|
760
|
+
|
|
761
|
+
So an entry may carry the exact served name in its route, and only the value
|
|
762
|
+
on the wire changes. Everything metered stays keyed by the catalogue key,
|
|
763
|
+
which is what keeps one model from splitting into two usage lines.
|
|
764
|
+
"""
|
|
765
|
+
route = LLMProxy._model_route(model_config)
|
|
766
|
+
served_name = str(route.get("model_name") or "").strip()
|
|
767
|
+
return served_name or model
|
|
768
|
+
|
|
749
769
|
@staticmethod
|
|
750
770
|
def _model_credential_ref(model_config: Dict[str, Any] | None) -> str | None:
|
|
751
771
|
"""The secret this model is entitled to run on, when the company owns it.
|
|
@@ -1806,6 +1806,17 @@ ui:
|
|
|
1806
1806
|
new_modal_title: "Create New Prompt"
|
|
1807
1807
|
name_label: "Name (Slug)"
|
|
1808
1808
|
name_help: "Use lowercase, numbers, and underscores only."
|
|
1809
|
+
create_name_label: "Name"
|
|
1810
|
+
create_name_placeholder: "Customer Support"
|
|
1811
|
+
create_name_help: "Used to suggest the technical identifier."
|
|
1812
|
+
create_key_label: "Technical ID"
|
|
1813
|
+
create_key_placeholder: "customer_support"
|
|
1814
|
+
create_key_help: "Stable snake_case identifier used internally."
|
|
1815
|
+
create_name_required: "Name is required."
|
|
1816
|
+
create_key_required: "Technical ID is required."
|
|
1817
|
+
create_creating: "Creating agent..."
|
|
1818
|
+
create_success: "Agent \"{name}\" created."
|
|
1819
|
+
create_failed: "Failed to create the agent."
|
|
1809
1820
|
category_label: "Category"
|
|
1810
1821
|
versions_btn: "Versions"
|
|
1811
1822
|
versions_modal_title: "Previous versions"
|
|
@@ -1848,8 +1859,9 @@ ui:
|
|
|
1848
1859
|
type_label: "Tool Type"
|
|
1849
1860
|
method_label: "Execution Method"
|
|
1850
1861
|
method_help: "Python method name in your company class implementation, or inference tool name."
|
|
1851
|
-
desc_label: "Description
|
|
1852
|
-
desc_placeholder: "Describe
|
|
1862
|
+
desc_label: "Description for the agent"
|
|
1863
|
+
desc_placeholder: "Describe for the agent when and how to use this tool..."
|
|
1864
|
+
desc_help: "This description guides the agent in deciding when to use this tool."
|
|
1853
1865
|
active_label: "Active"
|
|
1854
1866
|
|
|
1855
1867
|
# Schema Section
|
|
@@ -1877,6 +1889,14 @@ ui:
|
|
|
1877
1889
|
modal_title: "Create New Tool"
|
|
1878
1890
|
modal_name_label: "Tool Name (LLM Function)"
|
|
1879
1891
|
modal_name_help: "Use snake_case. Must be unique."
|
|
1892
|
+
modal_display_name_label: "Name"
|
|
1893
|
+
modal_display_name_placeholder: "Tax Calculator"
|
|
1894
|
+
modal_display_name_help: "Used to suggest the technical identifier."
|
|
1895
|
+
modal_display_name_required: "Name is required."
|
|
1896
|
+
modal_key_label: "Technical ID"
|
|
1897
|
+
modal_key_placeholder: "calculate_tax"
|
|
1898
|
+
modal_key_help: "Stable snake_case identifier used by prompts and routing."
|
|
1899
|
+
modal_key_required: "Technical ID is required."
|
|
1880
1900
|
modal_type_label: "Type"
|
|
1881
1901
|
modal_output_preset_label: "Output preset"
|
|
1882
1902
|
modal_output_preset_none: "No preset"
|
|
@@ -2172,6 +2192,7 @@ ui:
|
|
|
2172
2192
|
col_cost: "Cost"
|
|
2173
2193
|
col_key: "API key"
|
|
2174
2194
|
col_enabled: "Enabled"
|
|
2195
|
+
col_default: "Default"
|
|
2175
2196
|
col_reasoning: "Reasoning"
|
|
2176
2197
|
cost_metered: "Metered"
|
|
2177
2198
|
cost_not_billable: "No charge"
|
|
@@ -2206,6 +2227,8 @@ ui:
|
|
|
2206
2227
|
form_route_base_url_hint: "The full URL requests go to, e.g. https://your-host/v1"
|
|
2207
2228
|
form_route_api_key_env: "Credential variable"
|
|
2208
2229
|
form_route_api_key_env_hint: "The NAME of an environment variable in this deployment, e.g. OSS_LLM_API_KEY. Never the key itself."
|
|
2230
|
+
form_route_model_name: "Name served by the endpoint"
|
|
2231
|
+
form_route_model_name_hint: "Optional. The exact name this endpoint answers to, e.g. meta-llama/Llama-3.1-8B-Instruct. Leave empty to send the identifier above, which is stored in lowercase."
|
|
2209
2232
|
route_required: "This provider needs an endpoint and the name of its credential variable."
|
|
2210
2233
|
secrets:
|
|
2211
2234
|
title: "Secrets"
|
|
@@ -1811,6 +1811,17 @@ ui:
|
|
|
1811
1811
|
new_modal_title: "Crear Nuevo Prompt"
|
|
1812
1812
|
name_label: "Nombre (Slug)"
|
|
1813
1813
|
name_help: "Solo minúsculas, números y guiones bajos."
|
|
1814
|
+
create_name_label: "Nombre"
|
|
1815
|
+
create_name_placeholder: "Soporte al cliente"
|
|
1816
|
+
create_name_help: "Se usa para sugerir el identificador técnico."
|
|
1817
|
+
create_key_label: "ID técnico"
|
|
1818
|
+
create_key_placeholder: "soporte_cliente"
|
|
1819
|
+
create_key_help: "Identificador estable en snake_case usado internamente."
|
|
1820
|
+
create_name_required: "El nombre es obligatorio."
|
|
1821
|
+
create_key_required: "El ID técnico es obligatorio."
|
|
1822
|
+
create_creating: "Creando agente..."
|
|
1823
|
+
create_success: "Agente \"{name}\" creado."
|
|
1824
|
+
create_failed: "No se pudo crear el agente."
|
|
1814
1825
|
category_label: "Categoría"
|
|
1815
1826
|
versions_btn: "Versiones"
|
|
1816
1827
|
versions_modal_title: "Versiones antiguas"
|
|
@@ -1854,8 +1865,9 @@ ui:
|
|
|
1854
1865
|
type_label: "Tipo de Herramienta"
|
|
1855
1866
|
method_label: "Método a ejecutar"
|
|
1856
1867
|
method_help: "Nombre del método Python en la implementación de la clase de su empresa, o nombre de tool en inference"
|
|
1857
|
-
desc_label: "Descripción
|
|
1858
|
-
desc_placeholder: "Describe al
|
|
1868
|
+
desc_label: "Descripción para el agente"
|
|
1869
|
+
desc_placeholder: "Describe al agente cuándo y cómo usar esta tool..."
|
|
1870
|
+
desc_help: "Esta descripción guía al agente para decidir cuándo usar esta tool."
|
|
1859
1871
|
active_label: "Activo"
|
|
1860
1872
|
|
|
1861
1873
|
# Schema Section
|
|
@@ -1883,6 +1895,14 @@ ui:
|
|
|
1883
1895
|
modal_title: "Crear Nueva Herramienta"
|
|
1884
1896
|
modal_name_label: "Nombre (Función LLM)"
|
|
1885
1897
|
modal_name_help: "Usar snake_case. Debe ser único."
|
|
1898
|
+
modal_display_name_label: "Nombre"
|
|
1899
|
+
modal_display_name_placeholder: "Calculadora tributaria"
|
|
1900
|
+
modal_display_name_help: "Se usa para sugerir el identificador técnico."
|
|
1901
|
+
modal_display_name_required: "El nombre es obligatorio."
|
|
1902
|
+
modal_key_label: "ID técnico"
|
|
1903
|
+
modal_key_placeholder: "calcular_impuestos"
|
|
1904
|
+
modal_key_help: "Identificador estable en snake_case usado por prompts y routing."
|
|
1905
|
+
modal_key_required: "El ID técnico es obligatorio."
|
|
1886
1906
|
modal_type_label: "Tipo"
|
|
1887
1907
|
modal_output_preset_label: "Preset de output"
|
|
1888
1908
|
modal_output_preset_none: "Sin preset"
|
|
@@ -2178,6 +2198,7 @@ ui:
|
|
|
2178
2198
|
col_cost: "Costo"
|
|
2179
2199
|
col_key: "API key"
|
|
2180
2200
|
col_enabled: "Habilitado"
|
|
2201
|
+
col_default: "Por defecto"
|
|
2181
2202
|
col_reasoning: "Razonamiento"
|
|
2182
2203
|
cost_metered: "Con medición"
|
|
2183
2204
|
cost_not_billable: "Sin costo"
|
|
@@ -2212,6 +2233,8 @@ ui:
|
|
|
2212
2233
|
form_route_base_url_hint: "La URL completa a la que van las requests, ej. https://tu-host/v1"
|
|
2213
2234
|
form_route_api_key_env: "Variable de la credencial"
|
|
2214
2235
|
form_route_api_key_env_hint: "El NOMBRE de una variable de entorno de este deployment, ej. OSS_LLM_API_KEY. Nunca la key."
|
|
2236
|
+
form_route_model_name: "Nombre que sirve el endpoint"
|
|
2237
|
+
form_route_model_name_hint: "Opcional. El nombre exacto al que responde el endpoint, ej. meta-llama/Llama-3.1-8B-Instruct. Vacío envía el identificador de arriba, que se guarda en minúsculas."
|
|
2215
2238
|
route_required: "Este proveedor necesita un endpoint y el nombre de la variable con su credencial."
|
|
2216
2239
|
secrets:
|
|
2217
2240
|
title: "Secrets"
|
|
@@ -66,6 +66,12 @@ class LLMQueryRepo:
|
|
|
66
66
|
is_active=True
|
|
67
67
|
).first()
|
|
68
68
|
|
|
69
|
+
def get_tool_by_name(self, company: Company, tool_name: str) -> Tool | None:
|
|
70
|
+
return self.session.query(Tool).filter_by(
|
|
71
|
+
company_id=company.id,
|
|
72
|
+
name=tool_name,
|
|
73
|
+
).first()
|
|
74
|
+
|
|
69
75
|
def get_system_tool(self, tool_name: str) -> Tool | None:
|
|
70
76
|
return self.session.query(Tool).filter_by(
|
|
71
77
|
tool_type=Tool.TYPE_SYSTEM,
|
|
@@ -34,6 +34,22 @@ class EmbeddingClientWrapper:
|
|
|
34
34
|
"""Generates and returns an embedding for the given text."""
|
|
35
35
|
raise NotImplementedError
|
|
36
36
|
|
|
37
|
+
def get_embeddings(self, texts: list[str], suppress_error_logging: bool = False) -> list[list[float]]:
|
|
38
|
+
"""Embeds several texts, returning one vector per input in the same order.
|
|
39
|
+
|
|
40
|
+
The default walks the single-text path so every provider works without
|
|
41
|
+
changes; wrappers whose backend accepts a list override this with one
|
|
42
|
+
request per batch. Callers must not assume a single round trip.
|
|
43
|
+
"""
|
|
44
|
+
return [
|
|
45
|
+
self.get_embedding(text, suppress_error_logging=suppress_error_logging)
|
|
46
|
+
for text in texts
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
def supports_batching(self) -> bool:
|
|
50
|
+
"""Whether get_embeddings issues one request per batch instead of per text."""
|
|
51
|
+
return False
|
|
52
|
+
|
|
37
53
|
def get_image_embedding(self,
|
|
38
54
|
presigned_url: Optional[str] = None,
|
|
39
55
|
image_bytes: Optional[bytes] = None
|
|
@@ -71,6 +87,39 @@ class HuggingFaceClientWrapper(EmbeddingClientWrapper):
|
|
|
71
87
|
)
|
|
72
88
|
return result["embedding"]
|
|
73
89
|
|
|
90
|
+
def supports_batching(self) -> bool:
|
|
91
|
+
# Opt-in per tool: an endpoint still running a handler that predates
|
|
92
|
+
# inputs.texts would reject the batch payload, so this stays off until the
|
|
93
|
+
# deployment is confirmed via `supports_batch_embedding: true`.
|
|
94
|
+
return bool(self._tool_config().get("supports_batch_embedding"))
|
|
95
|
+
|
|
96
|
+
def _tool_config(self) -> dict:
|
|
97
|
+
try:
|
|
98
|
+
return self.inference_service._get_tool_config(self.company_short_name, self.tool_name) or {}
|
|
99
|
+
except Exception:
|
|
100
|
+
logging.debug("Could not read inference tool config for batching.", exc_info=True)
|
|
101
|
+
return {}
|
|
102
|
+
|
|
103
|
+
def get_embeddings(self, texts: list[str], suppress_error_logging: bool = False) -> list[list[float]]:
|
|
104
|
+
if not self.supports_batching():
|
|
105
|
+
return super().get_embeddings(texts, suppress_error_logging=suppress_error_logging)
|
|
106
|
+
|
|
107
|
+
result = self.inference_service.predict(
|
|
108
|
+
self.company_short_name,
|
|
109
|
+
self.tool_name,
|
|
110
|
+
{"mode": "text", "texts": list(texts)},
|
|
111
|
+
suppress_error_logging=suppress_error_logging,
|
|
112
|
+
)
|
|
113
|
+
embeddings = result.get("embeddings")
|
|
114
|
+
if not isinstance(embeddings, list) or len(embeddings) != len(texts):
|
|
115
|
+
# A silent length mismatch would pair each text with the wrong vector,
|
|
116
|
+
# which no downstream check would catch. Fail instead.
|
|
117
|
+
raise ValueError(
|
|
118
|
+
f"Batch embedding returned {len(embeddings) if isinstance(embeddings, list) else 'no'} "
|
|
119
|
+
f"vectors for {len(texts)} inputs."
|
|
120
|
+
)
|
|
121
|
+
return embeddings
|
|
122
|
+
|
|
74
123
|
def get_image_embedding(self,
|
|
75
124
|
presigned_url: Optional[str] = None,
|
|
76
125
|
image_bytes: Optional[bytes] = None
|
|
@@ -129,6 +178,24 @@ class OpenAIClientWrapper(EmbeddingClientWrapper):
|
|
|
129
178
|
response = self.client.embeddings.create(**kwargs)
|
|
130
179
|
return response.data[0].embedding
|
|
131
180
|
|
|
181
|
+
def supports_batching(self) -> bool:
|
|
182
|
+
return True
|
|
183
|
+
|
|
184
|
+
def get_embeddings(self, texts: list[str], suppress_error_logging: bool = False) -> list[list[float]]:
|
|
185
|
+
kwargs = {
|
|
186
|
+
"input": [text.replace("\n", " ") for text in texts],
|
|
187
|
+
"model": self.model,
|
|
188
|
+
}
|
|
189
|
+
if self.dimensions is not None:
|
|
190
|
+
kwargs["dimensions"] = self.dimensions
|
|
191
|
+
response = self.client.embeddings.create(**kwargs)
|
|
192
|
+
# The API documents input order, but pairing the wrong vector to a text is
|
|
193
|
+
# invisible downstream, so sort by index rather than trusting arrival order.
|
|
194
|
+
ordered = sorted(response.data, key=lambda item: item.index)
|
|
195
|
+
if len(ordered) != len(texts):
|
|
196
|
+
raise ValueError(f"Batch embedding returned {len(ordered)} vectors for {len(texts)} inputs.")
|
|
197
|
+
return [item.embedding for item in ordered]
|
|
198
|
+
|
|
132
199
|
class CustomClassClientWrapper(EmbeddingClientWrapper):
|
|
133
200
|
"""
|
|
134
201
|
Adapter for custom embedding classes defined by the user.
|
|
@@ -151,6 +218,20 @@ class CustomClassClientWrapper(EmbeddingClientWrapper):
|
|
|
151
218
|
return embedding[0]
|
|
152
219
|
return embedding
|
|
153
220
|
|
|
221
|
+
def supports_batching(self) -> bool:
|
|
222
|
+
return hasattr(self.client, "get_embeddings")
|
|
223
|
+
|
|
224
|
+
def get_embeddings(self, texts: list[str], suppress_error_logging: bool = False) -> list[list[float]]:
|
|
225
|
+
if not self.supports_batching():
|
|
226
|
+
return super().get_embeddings(texts, suppress_error_logging=suppress_error_logging)
|
|
227
|
+
embeddings = self.client.get_embeddings(list(texts))
|
|
228
|
+
if not isinstance(embeddings, list) or len(embeddings) != len(texts):
|
|
229
|
+
raise ValueError(
|
|
230
|
+
f"Batch embedding returned {len(embeddings) if isinstance(embeddings, list) else 'no'} "
|
|
231
|
+
f"vectors for {len(texts)} inputs."
|
|
232
|
+
)
|
|
233
|
+
return embeddings
|
|
234
|
+
|
|
154
235
|
def get_image_embedding(self,
|
|
155
236
|
presigned_url: Optional[str] = None,
|
|
156
237
|
image_bytes: Optional[bytes] = None
|
|
@@ -504,6 +585,80 @@ class EmbeddingService:
|
|
|
504
585
|
logging.error(f"Error generating embedding for text: {text[:80]}... - {e}")
|
|
505
586
|
raise
|
|
506
587
|
|
|
588
|
+
# Batch defaults: 32 texts is a good round trip for short records, and the
|
|
589
|
+
# character budget guards against a few long findings blowing the payload.
|
|
590
|
+
DEFAULT_EMBED_BATCH_SIZE = 32
|
|
591
|
+
DEFAULT_EMBED_BATCH_MAX_CHARS = 40000
|
|
592
|
+
|
|
593
|
+
def embed_texts(
|
|
594
|
+
self,
|
|
595
|
+
company_short_name: str,
|
|
596
|
+
texts: list[str],
|
|
597
|
+
model_type: str = 'text',
|
|
598
|
+
batch_size: Optional[int] = None,
|
|
599
|
+
max_chars_per_batch: Optional[int] = None,
|
|
600
|
+
suppress_error_logging: bool = False,
|
|
601
|
+
) -> list[list[float]]:
|
|
602
|
+
"""Embed many texts, returning one vector per input in the same order.
|
|
603
|
+
|
|
604
|
+
Resolves the company and the client once instead of once per text, and
|
|
605
|
+
sends batches when the provider supports them. If a batch fails, its
|
|
606
|
+
texts are retried one by one so a single bad input cannot lose the rest.
|
|
607
|
+
"""
|
|
608
|
+
if not texts:
|
|
609
|
+
return []
|
|
610
|
+
|
|
611
|
+
company = self.profile_repo.get_company_by_short_name(company_short_name)
|
|
612
|
+
if not company:
|
|
613
|
+
raise ValueError(self.i18n_service.t('errors.company_not_found', company_short_name=company_short_name))
|
|
614
|
+
client_wrapper = self.client_factory.get_client(company_short_name, model_type)
|
|
615
|
+
|
|
616
|
+
size = int(batch_size or self.DEFAULT_EMBED_BATCH_SIZE)
|
|
617
|
+
char_budget = int(max_chars_per_batch or self.DEFAULT_EMBED_BATCH_MAX_CHARS)
|
|
618
|
+
embeddings: list[list[float]] = []
|
|
619
|
+
for batch in self._chunk_texts(texts, size=size, char_budget=char_budget):
|
|
620
|
+
embeddings.extend(
|
|
621
|
+
self._embed_batch(
|
|
622
|
+
client_wrapper,
|
|
623
|
+
batch,
|
|
624
|
+
suppress_error_logging=suppress_error_logging,
|
|
625
|
+
)
|
|
626
|
+
)
|
|
627
|
+
if len(embeddings) != len(texts):
|
|
628
|
+
raise ValueError(f"Embedded {len(embeddings)} vectors for {len(texts)} texts.")
|
|
629
|
+
return embeddings
|
|
630
|
+
|
|
631
|
+
def _embed_batch(self, client_wrapper, batch: list[str], *, suppress_error_logging: bool) -> list[list[float]]:
|
|
632
|
+
try:
|
|
633
|
+
return client_wrapper.get_embeddings(batch, suppress_error_logging=suppress_error_logging)
|
|
634
|
+
except Exception as error:
|
|
635
|
+
if len(batch) == 1 or not client_wrapper.supports_batching():
|
|
636
|
+
raise
|
|
637
|
+
logging.warning(
|
|
638
|
+
"Batch embedding of %s texts failed (%s); retrying them individually.",
|
|
639
|
+
len(batch),
|
|
640
|
+
error,
|
|
641
|
+
)
|
|
642
|
+
return [
|
|
643
|
+
client_wrapper.get_embedding(text, suppress_error_logging=suppress_error_logging)
|
|
644
|
+
for text in batch
|
|
645
|
+
]
|
|
646
|
+
|
|
647
|
+
@staticmethod
|
|
648
|
+
def _chunk_texts(texts: list[str], *, size: int, char_budget: int):
|
|
649
|
+
"""Split by count and by characters, so a few long texts do not oversize a batch."""
|
|
650
|
+
batch: list[str] = []
|
|
651
|
+
batch_chars = 0
|
|
652
|
+
for text in texts:
|
|
653
|
+
length = len(text or "")
|
|
654
|
+
if batch and (len(batch) >= size or batch_chars + length > char_budget):
|
|
655
|
+
yield batch
|
|
656
|
+
batch, batch_chars = [], 0
|
|
657
|
+
batch.append(text)
|
|
658
|
+
batch_chars += length
|
|
659
|
+
if batch:
|
|
660
|
+
yield batch
|
|
661
|
+
|
|
507
662
|
def embed_image(self, company_short_name: str,
|
|
508
663
|
presigned_url: Optional[str] = None,
|
|
509
664
|
image_bytes: Optional[bytes] = None) -> list[float]:
|
|
@@ -22,8 +22,11 @@ from iatoolkit.common.exceptions import IAToolkitException
|
|
|
22
22
|
from iatoolkit.services.system_prompt_catalog import build_system_prompt_payload
|
|
23
23
|
from iatoolkit.services.structured_output_service import StructuredOutputService
|
|
24
24
|
import logging
|
|
25
|
+
import re
|
|
26
|
+
import unicodedata
|
|
25
27
|
|
|
26
28
|
class PromptService:
|
|
29
|
+
PROMPT_NAME_MAX_LENGTH = 255
|
|
27
30
|
OUTPUT_SCHEMA_MODE_BEST_EFFORT = "best_effort"
|
|
28
31
|
OUTPUT_SCHEMA_MODE_STRICT = "strict"
|
|
29
32
|
OUTPUT_RESPONSE_MODE_CHAT = "chat_compatible"
|
|
@@ -76,6 +79,34 @@ class PromptService:
|
|
|
76
79
|
self.sql_service = sql_service
|
|
77
80
|
self.configuration_service = configuration_service
|
|
78
81
|
|
|
82
|
+
@classmethod
|
|
83
|
+
def normalize_prompt_name(cls, prompt_name: str | None) -> str:
|
|
84
|
+
candidate = str(prompt_name or "").strip()
|
|
85
|
+
if not candidate:
|
|
86
|
+
raise IAToolkitException(
|
|
87
|
+
IAToolkitException.ErrorType.MISSING_PARAMETER,
|
|
88
|
+
"Prompt name is required",
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
normalized = unicodedata.normalize("NFKD", candidate).encode("ascii", "ignore").decode("ascii")
|
|
92
|
+
normalized = normalized.lower()
|
|
93
|
+
normalized = re.sub(r"[^a-z0-9]+", "_", normalized)
|
|
94
|
+
normalized = re.sub(r"_+", "_", normalized).strip("_")
|
|
95
|
+
|
|
96
|
+
if not normalized:
|
|
97
|
+
raise IAToolkitException(
|
|
98
|
+
IAToolkitException.ErrorType.INVALID_PARAMETER,
|
|
99
|
+
"Prompt name must contain letters or numbers",
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
if len(normalized) > cls.PROMPT_NAME_MAX_LENGTH:
|
|
103
|
+
raise IAToolkitException(
|
|
104
|
+
IAToolkitException.ErrorType.INVALID_PARAMETER,
|
|
105
|
+
f"Prompt name must be {cls.PROMPT_NAME_MAX_LENGTH} characters or fewer",
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
return normalized
|
|
109
|
+
|
|
79
110
|
def _normalize_execution_mode(
|
|
80
111
|
self,
|
|
81
112
|
execution_mode: str | None,
|