Mintplex-Labs/anything-llm · error · Error

SambaNova chat: No results length!

Error message

SambaNova chat: No results length!

What it means

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.

Solutions

  1. Retry the request; SambaNova returned a results array with zero entries.
  2. Try a different model or prompt.
Defensive patterns

Strategy: validation

When it happens

Trigger: SambaNova chat completion returned results with zero length.

Common situations: 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.


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/de832d7b6d105c82. Report an issue: GitHub.

Appendix: source

Thrown at server/utils/agents/aibitat/providers/sambanova.js:43

  get client() {
    return this._client;
  }

  get supportsAgentStreaming() {
    return true;
  }

  async #handleFunctionCallChat({ messages = [] }) {
    return await this.client.chat.completions
      .create({
        model: this.model,
        messages,
      })
      .then((result) => {
        if (!result.hasOwnProperty("choices"))
          throw new Error("SambaNova chat: No results!");
        if (result.choices.length === 0)
          throw new Error("SambaNova chat: No results length!");
        return result.choices[0].message.content;
      });
  }

  async #handleFunctionCallStream({ messages = [] }) {
    return await this.client.chat.completions.create({
      model: this.model,
      stream: true,
      messages,
    });
  }

  async stream(messages, functions = [], eventHandler = null) {
    const useNative = this.supportsNativeToolCalling();

    if (!useNative) {
      return await UnTooled.prototype.stream.call(
        this,

View on GitHub (pinned to 3aec848f28)