Here's how to get started with LlamaForge:
from llamaforge import Client
# Initialize the client
client = Client(api_key="your_api_key_here")
# Prepare input data
data = {
"text": "Your input text here",
"options": {
"format": "json",
"language": "en"
}
}
# Process the data
result = client.process(data)
print(result)
from llamaforge 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"
}
)
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)
from llamaforge 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}")
For a complete reference of all available methods and options, see the API Reference.