pip install pilott
export OPENAI_API_KEY="your-api-key"
text_extractor = Tool( name="text_extractor", parameters={ "file_path": "str", "format": "str" } )
content_analyzer = Tool( name="content_analyzer", parameters={ "text": "str", "analysis_type": "str" } )
summarizer = Tool( name="summarizer", parameters={ "text": "str", "max_length": "int" } )
from pilottai import Serve from pilottai.core import AgentConfig, LLMConfig # Initialize and run async def main(): pilott = Serve(name="DocumentProcessor") # Add document processing agent doc_processor = await pilott.add_agent( title="document_processor", goal="Process documents efficiently", tools=["text_extractor", "content_analyzer", "summarizer"] ) # Process a document job = { "type": "document_analysis", "document": { "path": "document.pdf", "type": "pdf" } } result = await pilott.execute([job])
job = { "type": "document_analysis", "description": "Analyze quarterly report" }
job = { "type": "text_extraction", "document": {"path": "file.pdf"} }
job = { "type": "summarization", "document": {"path": "article.txt"} }
config = AgentConfig( title="document_processor", goal="Process documents efficiently", max_concurrent_jobs=5, job_timeout=300 )
# Example result { 'success': True, 'output': { 'summary': 'Document summary...', 'analysis': 'Content analysis...', 'metadata': { 'pages': 5, 'format': 'pdf', 'processing_time': '2.3s' } } }