Mintplex-Labs/anything-llm · error · Error

SambaNova chat: No results!

Error message

SambaNova chat: No results!

What it means

Response-shape guard in SambaNova #handleFunctionCallChat: the completion response has no choices property at all, meaning SambaNova returned an error or unexpected payload shape instead of a completion, so there is no content to extract.

Solutions

  1. Retry the request; the SambaNova service returned an empty response.
  2. Verify the SambaNova API key and model name.
Defensive patterns

Strategy: validation

When it happens

Trigger: SambaNova chat completion returned no results.

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/512f79ac474147cb. Report an issue: GitHub.

Appendix: source

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

  }

  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) {

View on GitHub (pinned to 3aec848f28)