Scalar functions in Flock operate on data row-by-row, providing powerful operations for text processing, embeddings, and machine learning tasks directly within SQL queries.

1. Available Functions

  • llm_complete: Generates completions — text, image, and voice (audio)
  • llm_filter: Filters rows — text, image, and voice (audio)
  • llm_embedding: Text embeddings (image/voice via describe or transcribe first)
For combining retrieval scores, see Hybrid Search.

2. Function Characteristics

  • Applied row-by-row to table data
  • Modalities: Each LLM function page documents Text, Image, and Voice support with examples
  • Context columns: Unified context_columns array for tabular, image, and audio inputs
  • Structured output: Schema-shaped JSON via model_parameters where applicable (see each function’s Output)

3. Context Columns API

  • data (required): SQL column value
  • name (optional): Alias for the prompt
  • type (optional): "tabular" (default), "image", or "audio"
  • transcription_model (required for audio): e.g. whisper-1 (OpenAI / Azure)

4. Common Use Cases

  • Text generation, classification, and filtering
  • Image description and visual filtering
  • Voice transcription and call analytics
  • Embeddings and similarity search (text; image/voice via two-step workflows)