# AI Chat Platform Configuration
server:
  port: 8080
  servlet:
    context-path: /api
  error:
    include-message: always
    include-binding-errors: always

spring:
  application:
    name: ai-chat-platform
  profiles:
    active: development
  
  # Database Configuration
  datasource:
    url: jdbc:sqlite:file:./data/ai-chat-platform.db
    driver-class-name: org.sqlite.JDBC

  jpa:
    database-platform: org.hibernate.community.dialect.SQLiteDialect
    hibernate:
      ddl-auto: update
      naming:
        physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
    show-sql: false
    properties:
      hibernate:
        format_sql: true
        use_sql_comments: true

  # Jackson Configuration
  jackson:
    default-property-inclusion: non_null
    serialization:
      write-dates-as-timestamps: false
    deserialization:
      fail-on-unknown-properties: false

# API Documentation
springdoc:
  api-docs:
    path: /v1/api-docs
  swagger-ui:
    path: /v1/swagger-ui.html
    operationsSorter: method
  info:
    title: AI Chat Platform API
    description: Enterprise-grade AI Chat Platform
    version: 1.0.0
    contact:
      name: Pablo TJ
      email: pablo@example.com

# AI Model Configuration
ai:
  model:
    provider: llama
    name: openchat-3.5-0106.Q4_K_M
    path: models/${ai.model.name}.gguf
    
    # Performance Settings
    inference:
      max-tokens: 2048
      temperature: 0.7
      top-p: 0.9
      top-k: 40
      threads: 8

    # GPU Configuration
    gpu:
      enabled: true
      layers: 35
      main-gpu: 0

    # Context Management
    context:
      size: 4096
      keep: 1024

# Monitoring & Management
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus
  endpoint:
    health:
      show-details: when-authorized
  metrics:
    export:
      prometheus:
        enabled: true

# Logging Configuration
logging:
  level:
    com.pablotj.ai.chat: DEBUG
    org.springframework.web: INFO
    org.hibernate.SQL: DEBUG
    org.hibernate.type.descriptor.sql.BasicBinder: TRACE
  pattern:
    console: "%d{yyyy-MM-dd HH:mm:ss} - %msg%n"
    file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
  file:
    name: logs/ai-chat-platform.log

# Application Specific
app:
  chat:
    max-conversations-per-user: 100
    max-messages-per-conversation: 1000
    conversation-timeout-minutes: 30

  security:
    cors:
      allowed-origins: "*"
      allowed-methods: GET,POST,PUT,DELETE,OPTIONS
      allowed-headers: "*"

  performance:
    async:
      core-pool-size: 10
      max-pool-size: 50
      queue-capacity: 100
