The context object
The SDK file to be processed.
Options including the prompt, OCR configuration (if needed), and any AI options such as provider, model, and config.
A promise resolving to the AI response.
const response = await askFile(ctx, file, {
prompt: 'What is the main question in this document?',
provider: SkillSecretType.OpenAi,
config: { openAiApiKey: 'your-api-key' },
model: 'gpt-4o-mini',
ocrOptions: {
endpoint: 'https://{YOUR_ENDPOINT}.cognitiveservices.azure.com/',
key: 'YOUR_OCR_KEY'
}
});
console.log(response.text);
Processes a file by running OCR on supported file types (PDF or image) and then extracting a question based on a prompt. For other file types, the file’s content is sent directly to the AI helper.