{"record":{"id":"e92650fd2ed4ac21","repo":"BoundaryML/baml","slug":"no-llm-response","errorCode":null,"errorMessage":"No LLM response: {}","messagePattern":"No LLM response: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"engine/language_client_ruby/ext/ruby_ffi/src/function_result.rs","lineNumber":26,"sourceCode":"pub struct FunctionResult {\n    inner: baml_runtime::FunctionResult,\n}\n\nimpl FunctionResult {\n    pub fn new(inner: baml_runtime::FunctionResult) -> Self {\n        Self { inner }\n    }\n\n    #[allow(dead_code)]\n    fn to_s(&self) -> String {\n        format!(\"{}\", self.inner)\n    }\n\n    #[allow(dead_code)]\n    fn raw(&self) -> Result<String> {\n        match self.inner.content() {\n            Ok(content) => Ok(content.to_string()),\n            Err(_) => Err(Error::new(\n                runtime_error(),\n                format!(\"No LLM response: {}\", self.inner),\n            )),\n        }\n    }\n\n    pub fn parsed_using_types(\n        ruby: &Ruby,\n        rb_self: &FunctionResult,\n        types: RModule,\n        partial_types: RModule,\n        allow_partials: bool,\n    ) -> Result<Value> {\n        let res = match rb_self.inner.result_with_constraints_content() {\n            Ok(parsed) => ruby_to_json::RubyToJson::serialize_baml(\n                ruby,\n                types,\n                partial_types,","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_ruby/ext/ruby_ffi/src/function_result.rs#L8-L44","documentation":"The Ruby FFI's FunctionResult#raw calls into the Rust core's content(); if the LLM produced no content (e.g. the request failed or was not completed), it raises a Ruby RuntimeError 'No LLM response: <result>'.","triggerScenarios":"Calling .raw on a FunctionResult whose underlying content is Err — i.e. the LLM call failed before producing a response body.","commonSituations":"Provider outages, invalid API keys, or timeouts causing a failed result whose object is then inspected with raw instead of checking success first.","solutions":["Check result success/status before calling raw","Inspect the underlying error via the raised exception message or result error accessor","Add retry/fallback logic in your BAML function config (retry policies, fallback providers)","Verify API key and network connectivity"],"exampleFix":"// before\nputs result.raw\n// after\nbegin\n  puts result.raw\nrescue RuntimeError => e\n  warn \"LLM call failed: #{e.message}\"\nend","handlingStrategy":"try-catch","validationCode":"# check the result carries content before calling raw\nraise 'no content' if result.nil? || !result.respond_to?(:raw)","typeGuard":null,"tryCatchPattern":"begin\n  raw = result.raw\nrescue RuntimeError => e\n  logger.warn(e.message)\n  raw = nil\nend","preventionTips":["Check result status/success before raw","Configure retry and fallback client strategies","Monitor provider errors via BAML's error events"],"tags":["ruby","ffi","llm-response"],"backgroundTag":"empty-response-body","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}