Core APIs
LLM APIs
Reference for LLM utilities in Agenite
Overview
The LLM package in Agenite provides utilities for working with language models, including message formatting, content types, and provider interfaces.
Message types
Base message
Content blocks
Messages can contain different types of content:
Provider interface
The core LLM Provider interface:
Generate options
Response types
Base provider implementation
The BaseLLMProvider
class provides a base implementation of the LLM provider interface:
Utility functions
String to message conversion
Tool definition
Example usage
Simple generation
Streaming responses
Tool usage
Creating a custom provider
Best practices
- Message formatting: Use the standard message format for consistent behavior
- Error handling: Implement robust error handling in custom providers
- Streaming: Support streaming for better user experience with long responses
- Token tracking: Track token usage for monitoring and rate limiting
- Content typing: Use the appropriate content block types for rich responses
Next steps
- Learn about providers
- See examples
- Read about core concepts