# Solace AI Connector Example: A2A ADK Host Component Configurations
#
# This file demonstrates various ways to configure the A2A_ADK_HostComponent.
# The app-level 'namespace' will be automatically prepended
# to queue names by the custom A2A_ADK_App class.
# The required A2A subscriptions are also automatically generated by A2A_ADK_App.
# Remember to set required environment variables (e.g., SOLACE_*, GOOGLE_API_KEY,
# GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION, specific LLM keys, NAMESPACE).

log:
  stdout_log_level: INFO
  log_file_level: DEBUG # Changed from INFO to DEBUG to capture ADK INFO logs
  log_file: a2a_host_example.log

# Shared SAM config
!include shared_config.yaml

apps:
  # Example 1: Custom OpenAI-Compatible LLM Agent
  - name: custom_llm_agent_app
    app_base_path: .
    app_module: src.solace_agent_mesh.agent.sac.app # Use the custom App class in its new location
    broker:
      <<: *broker_connection

    # App Level Config
    app_config:
      namespace: ${NAMESPACE} # Your A2A topic namespace
      supports_streaming: true # Host capability flag
      agent_name: "CustomLLMAgent"
      display_name: "Custom LLM"

      #model: *planning_model # Use the planning model for this agent
      model: *multimodal_model # Use the planning model for this agent

      instruction: | # User-provided instruction
        You are a helpful assistant named CustomLLMAgent, accessed via a custom endpoint.
        Note that if the user asks you to create a file/artifact, do it and unless explicitly told otherwise, return that file to the user immediately. 
        When you create a file, never give a preview of the file content before creating it. This just wastes time. The user can just get the file after it is created.
        Give frequent status updates through the status_update embed directives as you work on the task and especially just before you perform tool calls.
      session_service:
        type: "memory"
        default_behavior: "PERSISTENT" # Or "RUN_BASED"
      artifact_service:
        type: "filesystem"
        base_path: "/tmp/samv2"
        artifact_scope: namespace # Default scope, shares artifacts within the NAMESPACE
      artifact_handling_mode: "reference" # Embed artifacts created by *this* agent
      enable_embed_resolution: true # Enable embed feature and instruction injection
      enable_artifact_content_instruction: true # Enable instruction for late-stage embed
      tools:
        - tool_type: builtin-group
          group_name: "artifact_management"
        - tool_type: builtin-group
          group_name: "data_analysis"

      # Agent Card Definition (Simplified)
      agent_card:
        description: "A helpful assistant accessed via a custom endpoint, capable of delegating tasks."
        defaultInputModes: ["text"] # Optional, Defaults to ["text"] if omitted
        defaultOutputModes: ["text", "file"] # Indicate potential file output
        skills: [] # Keep, but now optional (defaults to empty list)
        # documentationUrl: Optional
        # provider: Optional
      # Discovery & Communication
      agent_card_publishing: { interval_seconds: 10 }
      agent_discovery: { enabled: true } # Enable discovery and peer delegation instruction injection
      inter_agent_communication:
        allow_list: ["*"]
        request_timeout_seconds: 30

  # Example 2: Agent with Local Python Tool and GCS Artifacts
  # - name: tool_agent_app
  #   app_base_path: .
  #   app_module: src.solace_agent_mesh.agent.sac.app # Use the custom App class in its new location
  #   broker:
  #     <<: *broker_connection

  #   # App Level Config
  #   app_config:
  #     namespace: ${NAMESPACE} # Different namespace
  #     supports_streaming: false
  #     agent_name: "ToolAgent"
  #     model: "gemini-1.5-flash" # Keeping Gemini here for contrast, could also be changed
  #     instruction: | # User-provided instruction
  #       I can use tools to help you. I know how to calculate squares and create files.
  #       (Instructions about embeds, file tools, and peer delegation will be added automatically if enabled below)
  #     tools:
  #       - tool_type: python
  #         component_module: "examples.sample_tools"
  #         function_name: "calculate_square"
  #       - tool_type: python
  #         component_module: "examples.sample_tools"
  #         function_name: "create_file" # Added the new tool
  #     session_service: { type: "memory" }
  #     artifact_service:
  #       type: "filesystem"
  #       base_path: "/tmp/samv2"
  #       artifact_scope: app # Isolate artifacts to this specific app instance ('tool_agent_app')
  #       # Example GCS config (if using type: gcs)
  #       # type: gcs
  #       # bucket_name: "your-gcs-bucket-name"
  #       # Example Memory config (if using type: memory)
  #       # type: memory
  #       # Example Custom Scope config:
  #       # type: filesystem
  #       # base_path: "/mnt/shared_project_x"
  #       # artifact_scope: custom
  #       # artifact_scope_value: "project_x_shared_files"
  #     artifact_handling_mode: "reference" # Embed artifact data in A2A messages
  #     enable_embed_resolution: true # Enable embed feature and instruction injection
  #     enable_artifact_content_instruction: true # Enable instruction for late-stage embed
  #     # Agent Card Definition (Simplified)
  #     agent_card:
  #       description: "An agent that uses tools like calculation, file creation, and search."
  #       defaultInputModes: ["text", "application/json"] # Example override
  #       defaultOutputModes: ["text", "file"] # Indicate potential file output
  #       skills: # Skills are already defined here, no change needed
  #         - id: "calculator"
  #           name: "Square Calculator"
  #           description: "Calculates the square of a number."
  #         - id: "file_creator" # Added skill for the new tool
  #           name: "File Creator"
  #           description: "Creates a file with the provided content."
  #     # Discovery & Communication
  #     agent_card_publishing: { interval_seconds: 10 }
  #     agent_discovery: { enabled: true } # Enable discovery and peer delegation instruction injection
  #     inter_agent_communication:
  #       allow_list: ["*"]
  #       deny_list: ["ClaudeAgent"]
  #       request_timeout_seconds: 20
