{"record":{"id":"de832d7b6d105c82","repo":"Mintplex-Labs/anything-llm","slug":"sambanova-chat-no-results-length","errorCode":null,"errorMessage":"SambaNova chat: No results length!","messagePattern":"SambaNova chat: No results length!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/aibitat/providers/sambanova.js","lineNumber":43,"sourceCode":"  get client() {\n    return this._client;\n  }\n\n  get supportsAgentStreaming() {\n    return true;\n  }\n\n  async #handleFunctionCallChat({ messages = [] }) {\n    return await this.client.chat.completions\n      .create({\n        model: this.model,\n        messages,\n      })\n      .then((result) => {\n        if (!result.hasOwnProperty(\"choices\"))\n          throw new Error(\"SambaNova chat: No results!\");\n        if (result.choices.length === 0)\n          throw new Error(\"SambaNova chat: No results length!\");\n        return result.choices[0].message.content;\n      });\n  }\n\n  async #handleFunctionCallStream({ messages = [] }) {\n    return await this.client.chat.completions.create({\n      model: this.model,\n      stream: true,\n      messages,\n    });\n  }\n\n  async stream(messages, functions = [], eventHandler = null) {\n    const useNative = this.supportsNativeToolCalling();\n\n    if (!useNative) {\n      return await UnTooled.prototype.stream.call(\n        this,","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/agents/aibitat/providers/sambanova.js#L25-L61","documentation":"Response-shape guard in SambaNova #handleFunctionCallChat: a choices array exists but is empty, meaning SambaNova acknowledged the request yet produced zero candidate completions, leaving no message content for the agent turn.","triggerScenarios":"SambaNova chat completion returned results with zero length.","commonSituations":"This error is raised at runtime in server/utils/agents/aibitat/providers/sambanova.js. It occurs when the required configuration for this provider is missing or invalid (unset environment variables, empty API key or base path), when the external service is unreachable or returns an unexpected response, or when invalid input reaches the call site. To prevent it, validate the relevant provider settings and environment variables at startup and confirm the service is reachable before this code path executes.","solutions":["Retry the request; SambaNova returned a results array with zero entries.","Try a different model or prompt."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}