Permit Desk
Pull the ID, issuing office, and approved activities from a one-page PDF. The sample omits the emergency phone number.
Model scaledown/extract
Source
Fields to extract
permit_idtext- The alphanumeric expedition permit identifier.
issuing_officetext- The name of the office listed as the issuing office.
approved_activitieslist · text- Individual activities listed under Approved Activities.
emergency_phonetext- The emergency contact phone number, if printed on the permit.
View C# example
using ExtractionsDotNet;
using var client = OpenRouterExtractionsClient.FromEnvironment();
var response = await client.ExtractAsync(new ExtractionRequest("scaledown/extract", // a PDF-capable model
new Dictionary<string, ExtractionField>
{
["permit_id"] = new TextField { Instructions = "The alphanumeric expedition permit identifier." },
["issuing_office"] = new TextField { Instructions = "The name of the office listed as the issuing office." },
["approved_activities"] = new ListField(ListItemType.Text),
["emergency_phone"] = new TextField { Instructions = "The emergency contact phone number, if printed on the permit." }
})
{
Assets = new Dictionary<string, ExtractionAsset>
{
["expedition-permit"] = new(ExtractionAssetFormat.Pdf, await File.ReadAllBytesAsync("north-ridge-permit.pdf"))
}
});
Console.WriteLine($"{response.GetText("permit_id").Value} from {response.GetText("issuing_office").Value}");
// A field the document lacks comes back with a null Value; Guess may still hold the model's best attempt.
var phone = response.GetText("emergency_phone");
Console.WriteLine(phone.Value is null ? $"No emergency phone printed (guess: {phone.Guess ?? "none"})" : phone.Value);