Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ jobs:
uses: astral-sh/setup-uv@v6
- name: Sync dependencies
run: uv sync --group dev
- name: Lint (Ruff)
- name: Lint
run: uv run lint
- name: Black
run: uv run black --check .
- name: Typecheck (mypy)
run: uv run typecheck

Expand Down Expand Up @@ -67,9 +65,25 @@ jobs:
- name: Evaluations (Mock Mode)
run: uv run python -m intent_kit.evals.run_all_evals --quiet --mock

security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Sync dependencies
run: uv sync --group dev
- name: Install pip-audit
run: uv add --group dev pip-audit
- name: Security audit
run: uv run pip-audit --local

build:
runs-on: ubuntu-latest
needs: [test, eval]
needs: [test, eval, security]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ repos:
language: system
files: .codecov.yml
pass_filenames: false
- id: security
name: Security audit
entry: uv run security
language: system
pass_filenames: false
- id: auto-amend
name: Auto-amend commit with reformatted files
entry: uv run auto-amend
language: system
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ This means you can deploy with confidence, knowing your AI workflows work reliab
- Catch regressions automatically
- Validate reliability before deployment

### **Security**
- Automated security audits with pip-audit
- Vulnerability scanning in CI/CD pipeline
- Dependency security monitoring

---

## Common Use Cases
Expand Down Expand Up @@ -340,8 +345,9 @@ uv run pre-commit install
```bash
uv run pytest # Run tests
uv run lint # Lint code
uv run black --check . # Format check
uv run black --fix . # Format and fix code
uv run typecheck # Type checking
uv run security # Security audit
uv build # Build package
```

Expand Down
76 changes: 76 additions & 0 deletions docs/concepts/nodes-and-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,82 @@ weather_action = action(
- **action_func** - Function to execute
- **param_schema** - Parameter type definitions

#### Argument Extraction

Actions automatically extract parameters from user input using the argument extraction system:

- **RuleBasedArgumentExtractor** - Uses pattern matching and rules for fast extraction
- **LLMArgumentExtractor** - Uses LLM for intelligent parameter extraction
- **Automatic Selection** - Intent Kit chooses the best extractor based on your configuration

```python
from intent_kit import action

# Rule-based extraction (fast, deterministic)
greet_action = action(
name="greet",
description="Greet the user",
action_func=lambda name: f"Hello {name}!",
param_schema={"name": str},
argument_extractor="rule" # Use rule-based extraction
)

# LLM-based extraction (intelligent, flexible)
weather_action = action(
name="weather",
description="Get weather information",
action_func=lambda city: f"Weather in {city} is sunny",
param_schema={"city": str},
argument_extractor="llm" # Use LLM extraction
)
```

#### Error Handling Strategies

Actions support pluggable error handling strategies for robust execution:

```python
from intent_kit import action

# Retry on failure
retry_action = action(
name="retry_example",
description="Example with retry strategy",
action_func=lambda x: x / 0, # Will fail
param_schema={"x": float},
remediation_strategy="retry_on_fail",
remediation_config={
"max_attempts": 3,
"base_delay": 1.0
}
)

# Fallback to another action
fallback_action = action(
name="fallback_example",
description="Example with fallback strategy",
action_func=lambda x: x / 0, # Will fail
param_schema={"x": float},
remediation_strategy="fallback_to_another_node",
remediation_config={
"fallback_name": "safe_calculation"
}
)

# Self-reflection for parameter correction
reflect_action = action(
name="reflect_example",
description="Example with self-reflection",
action_func=lambda name: f"Hello {name}!",
param_schema={"name": str},
remediation_strategy="self_reflect",
remediation_config={
"max_reflections": 2,
"llm_config": {"provider": "openai", "model": "gpt-3.5-turbo"}
}
)
```

### Classifier Nodes

Classifier nodes route input to appropriate child nodes based on classification logic.
Expand Down
2 changes: 1 addition & 1 deletion docs/development/documentation-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The documentation has been updated to use consistent terminology:

- **Actions** instead of "handlers" - Functions that execute and produce outputs
- **Classifiers** - Nodes that route input to appropriate actions
- **Splitters** - Nodes that handle multiple nodes in single input
- **Classifiers** - Nodes that route input to appropriate actions

## Navigation Structure

Expand Down
1 change: 1 addition & 0 deletions docs/development/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ Welcome to the Development section of the Intent Kit documentation. Here you'll
- [Testing](testing.md): Unit tests and integration testing.
- [Evaluation](evaluation.md): Performance evaluation and benchmarking.
- [Debugging](debugging.md): Debugging tools and techniques.
- [Performance Monitoring](performance-monitoring.md): Performance tracking and reporting.

For additional information, see the [project README on GitHub](https://github.com/Stephen-Collins-tech/intent-kit#readme) or explore other sections of the documentation.
Loading