Syntax
| AI.AttachFile(Handle As Long, FilePath As String, [Caption As String]) As Boolean
| ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description
| Attaches a file to a conversation handle, so the model can read its contents. Call this before Ask, on a handle obtained from NewConversation. The return value is True on success, or False on a validation error — in which case LastErrorCode and LastErrorMessage give the reason.
A handle accepts up to 5 files. Each file must not exceed 20 MB, and the combined size of all attachments on one handle must not exceed 30 MB.
Supported file types
Any other extension is rejected with error code aiErrUnsupportedMime.
| ||||||||||||||||||||
See Also
| NewConversation, AttachRecordset, ClearAttachments, AttachmentCount, Ask.
| ||||||||||||||||||||
Example
| Dim aiHnd As Long
aiHnd = AI.NewConversation(aiGeneral)
If AI.AttachFile(aiHnd, "O:\Post\invoice_24018.pdf", "Incoming invoice") Then
aiHnd = AI.Ask("Extract the invoice number, date and total amount.", , aiHnd)
End If
|