Files
cleveragents-core/examples/actors/llm_with_tools.yaml
T
aditya 4ae7f2d6fe test(actor): fix actor examples test suite issues
- Add missing node descriptions in Behave test scenarios
- Fix context_view and parallel execution step definitions
- Update llm_with_tools.yaml max_context_tokens (10000 → 16000)
- Add context.error compatibility for error assertions

Results: Behave 25/25, Robot 16/16, ASV 7/7 all newly added tests passing.
2026-02-18 12:18:37 +00:00

68 lines
1.7 KiB
YAML

# LLM Actor with Tools
# Demonstrates an LLM actor with access to multiple tools
name: assistants/file_analyzer
type: llm
description: Analyzes files and generates reports using file system tools
version: "1.0"
# LLM configuration
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