BoundaryML/baml · error · anyhow::Error

BAML internal error (openai-transcriptions): chat message…

Error message

BAML internal error (openai-transcriptions): chat message formatting is not used for multipart transcriptions

What it means

format_message_content only knows how to format chat message parts for the Responses API; for the transcriptions strategy it bails because chat-style message formatting is meaningless for multipart audio transcription requests. Like 982, this is an unimplemented-path guard.

Solutions

  1. Avoid the transcriptions strategy in BAML clients; use chat completions/responses instead
  2. Perform transcription calls directly against OpenAI's /v1/audio/transcriptions outside BAML
  3. Wait for BAML to implement multipart transcriptions formatting
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: A transcriptions-strategy client path invokes format_message_content with rendered ChatMessageParts, e.g. when building the body for a transcriptions API request.

Common situations: Same as 982: a client configured for the OpenAI transcriptions strategy; any prompt render reaches this bail.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/1cd4f3b06e81e636. Report an issue: GitHub.

Appendix: source

Thrown at engine/baml-runtime/src/internal/llm_client/primitive/openai/openai_client.rs:347

                            }),
                        );
                    }
                }
            }
        }
    }

    fn format_message_content(
        &self,
        content: &RenderedChatMessage,
        parts_to_message: &dyn Fn(
            &[ChatMessagePart],
        )
            -> Result<Vec<serde_json::Map<String, serde_json::Value>>>,
    ) -> Result<serde_json::Value> {
        match self {
            ProviderStrategy::TranscriptionsApi => {
                anyhow::bail!(
                    "BAML internal error (openai-transcriptions): chat message formatting is not used for multipart transcriptions"
                );
            }
            ProviderStrategy::ResponsesApi => {
                // For responses API, use standard formatting
                Ok(json!(parts_to_message(&content.parts)?))
            }
            ProviderStrategy::StandardOpenAI { provider } => {
                if provider == "openai-generic" {
                    // Check if all parts are text
                    let all_text = content
                        .parts
                        .iter()
                        .all(|part| matches!(part, ChatMessagePart::Text(_)));
                    if all_text {
                        // Concatenate all text parts into a single string
                        let combined_text = content
                            .parts

View on GitHub (pinned to bd85ce9dee)