LlamaSearch-pdf Usage Guide

Basic Usage

Here's how to get started with LlamaSearch-pdf:

Example: Initialize the Client

from llamasearch-pdf import Client

# Initialize the client
client = Client(api_key="your_api_key_here")

Example: Process Data

# Prepare input data
data = {
    "text": "Your input text here",
    "options": {
        "format": "json",
        "language": "en"
    }
}

# Process the data
result = client.process(data)
print(result)

Advanced Usage

Example: Custom Configuration

from llamasearch-pdf import Client

# Initialize with custom configuration
config = {
    "timeout": 30,
    "retries": 3,
    "cache_enabled": True
}

client = Client(api_key="your_api_key_here", config=config)

# Process with advanced options
result = client.process(
    data={"text": "Advanced processing example"},
    options={
        "model": "large",
        "precision": "high"
    }
)

Example: Batch Processing

batch_data = [
    {"text": "First document"},
    {"text": "Second document"},
    {"text": "Third document"}
]

# Process batch
results = [client.process(item) for item in batch_data]

# Analyze results
for i, result in enumerate(results):
    print(f"Result {i+1}:", result)

Error Handling

from llamasearch-pdf import Client, ApiError

client = Client(api_key="your_api_key_here")

try:
    result = client.process({"invalid": "data"})
except ApiError as e:
    print(f"API Error: {e}")
except Exception as e:
    print(f"Unexpected error: {e}")

Next Steps

For a complete reference of all available methods and options, see the API Reference.