Skip to main content

extract_semantic

Function extract_semantic 

Source
pub async fn extract_semantic(
    path: &Path,
    content: &str,
    file_type: &str,
    api_key: &str,
) -> Result<ExtractionResult>
Expand description

Extract semantic concepts from a document, paper, or image using the Claude API.

§Arguments

  • path — the file path (used for source_file metadata)
  • content — the text content to analyse
  • file_type — one of "document", "paper", or "image"
  • api_key — Anthropic API key

§Errors

Returns an error if the HTTP request fails or the response cannot be parsed.