adm_ai_rag_extract_api
LLM-based file text extraction for RAG collections.
An alternative to the built-in adm_storage_index_api.extract_text_from_blob: the file is sent to a multimodal LLM (via UC AI file input) which returns a clean textual transcription. Used by adm_ai_rag_workflow_api when a collection configures an llm_text_extraction section. Lives in the AI pack because it depends on uc_ai (the base adm_storage_index_api must stay uc_ai-free).
NOTE: file input requires a provider/model that supports it (Anthropic, Gemini, OpenAI). UC AI’s OCI provider does not currently support file input.
Functions and Procedures
Section titled “Functions and Procedures”extract_text_via_llm
Section titled “extract_text_via_llm”Sends a file to an LLM and returns its extracted text content. Raises on empty or truncated (finish_reason = ‘length’) output so a partial transcription is never stored as index_content.
Signature:
function extract_text_via_llm ( p_file_blob in blob, p_mime_type in varchar2, p_provider in varchar2, p_model in varchar2, p_config in json_object_t default null, p_prompt in clob default null) return clob;Parameters:
| Name | Direction | Type | Description |
|---|---|---|---|
p_file_blob | in | blob | The file content |
p_mime_type | in | varchar2 | The file MIME type (e.g. ‘application/pdf’) |
p_provider | in | varchar2 | UC AI provider (must support file input) |
p_model | in | varchar2 | UC AI model |
p_config | in | json_object_t default null | Optional UC AI config passthrough (credential, provider block, max tokens) |
p_prompt | in | clob default null | Optional override of the default extraction prompt |
Returns: clob - The extracted text