# LLM Actor with Tools
# Demonstrates an LLM actor with access to multiple tools

name: local/assistants-file_analyzer
type: llm
description: Analyzes files and generates reports using file system tools
version: "1.0"

# LLM configuration
provider: openai
model: gpt-4-turbo
system_prompt: |
  You are a file analysis assistant. Use the available tools to:
  - Read and analyze file contents
  - Count lines, words, and characters
  - Search for patterns in files
  - Generate summary reports

  Always explain what you're doing before using a tool.

# Tools (mix of references and inline definitions)
tools:
  # Reference to existing tool
  - files/read_file
  - files/list_directory

  # Inline tool definition
  - name: utils/count_lines
    description: Count the number of lines in a file
    parameters:
      - name: file_path
        type: str
        description: Path to the file to count lines in
        required: true
    code: |
      def count_lines(file_path: str) -> int:
          """Count lines in a file."""
          with open(file_path, 'r', encoding='utf-8') as f:
              return len(f.readlines())

  - name: utils/word_count
    description: Count words in a file
    parameters:
      - name: file_path
        type: str
        description: Path to the file
        required: true
    code: |
      def word_count(file_path: str) -> int:
          """Count words in a file."""
          with open(file_path, 'r', encoding='utf-8') as f:
              content = f.read()
              return len(content.split())

# Context settings
context_view: executor
memory:
  enabled: true
  max_messages: 30
  max_tokens: 6000

context:
  max_context_tokens: 16000

# Environment variables
env_vars:
  WORK_DIR: ${HOME}/workspace
  LOG_LEVEL: info
