Document Operations
Overview
Basic Document Operations
Listing Documents
from health_universe_a2a import Agent, AgentContext
class DocumentProcessor(Agent):
def get_agent_name(self) -> str:
return "Document Processor"
def get_agent_description(self) -> str:
return "Processes and analyzes documents"
async def process_message(self, message: str, context: AgentContext) -> str:
# List all documents
docs = await context.document_client.list_documents()
# List only source documents (user uploads)
source_docs = await context.document_client.list_documents(role="source")
# List only artifacts (agent outputs)
artifacts = await context.document_client.list_documents(role="artifact")
# Include hidden documents
all_docs = await context.document_client.list_documents(include_hidden=True)
return f"Found {len(docs)} documents ({len(source_docs)} sources, {len(artifacts)} artifacts)"Reading Document Content
Filtering Documents
Writing and Updating Documents
Creating New Documents
Updating Existing Documents
Document Search
Text Search
Semantic Search
Processing Status and Waiting
Checking Processing Status
Waiting for Processing
Run Storage
Complete Example: Document Analysis Agent
Best Practices
Last updated
Was this helpful?