API Reference (Legacy)¶
Legacy API
This documents the v1 API. For new projects, use the Core API.
See Migration Guide to upgrade existing code.
This section provides detailed API documentation for all DCAF v1 components.
Components¶
| Component | Description |
|---|---|
| BedrockLLM | AWS Bedrock Converse API wrapper for model invocation |
| Tools | Tool creation system with @tool decorator and approval workflows |
| Agents | Pre-built agent classes and the AgentProtocol interface |
| Agent Server | FastAPI server for hosting agents |
| Schemas | Message schemas for the Help Desk protocol |
| Channel Routing | Slack and channel-specific response routing |
| CLI | Command-line tools for credential management |
Quick Links¶
Creating Tools¶
from dcaf.tools import tool
@tool(
schema={
"name": "my_tool",
"description": "Does something useful",
"input_schema": {
"type": "object",
"properties": {
"param": {"type": "string"}
}
}
},
requires_approval=True
)
def my_tool(param: str) -> str:
return f"Result: {param}"
Creating Agents¶
from dcaf.agents import ToolCallingAgent
from dcaf.llm import BedrockLLM
llm = BedrockLLM(region_name="us-east-1")
agent = ToolCallingAgent(
llm=llm,
tools=[my_tool],
system_prompt="You are a helpful assistant.",
model_id="us.anthropic.claude-3-5-sonnet-20240620-v1:0"
)
Serving Agents¶
from dcaf.agent_server import create_chat_app
import uvicorn
app = create_chat_app(agent)
uvicorn.run(app, host="0.0.0.0", port=8000)
Core API Reference¶
For the Core architecture with Clean Architecture, see: