Mintplex-Labs/anything-llm · error · Error
SambaNova chat: No results!
Error message
SambaNova chat: No results!
What it means
In SambaNovaProvider.#handleFunctionCallChat (sambanova.js:33-45), the UnTooled chat path asserts the response has a `choices` property and throws "SambaNova chat: No results!" when it is absent. SambaNova occasionally returns an error/empty payload that the SDK surfaces as a fulfilled object lacking choices.
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 526360e320)
Solutions
- Verify SAMBANOVA_LLM_API_KEY is valid and not expired.
- Confirm the model id is one SambaNova actually serves.
- Log the raw result object to see the actual envelope SambaNova returned.
- If the payload is a known error shape, surface it instead of the generic message.
- Retry once; transient malformed responses do occur.
Defensive patterns
Strategy: type-guard
Validate before calling
if (!process.env.SAMBANOVA_LLM_API_KEY)
throw new Error("SAMBANOVA_LLM_API_KEY is not set."); Type guard
/** @param {unknown} r
* @returns {r is { choices: unknown[] }} */
function hasChoices(r) {
return (
!!r &&
typeof r === "object" &&
Array.isArray(/** @type {any} */ (r).choices)
);
} Try / catch
try {
return await provider.complete(messages, functions);
} catch (e) {
if (/SambaNova chat: No results/.test(e.message)) {
// log the raw response and retry once; malformed envelopes are often transient
await new Promise((r) => setTimeout(r, 1000));
return await provider.complete(messages, functions);
}
throw e;
} Prevention
- Validate the API key and model id before the first call.
- Defensively check `choices` presence and length before indexing, both in your wrapper.
- Log the full raw response when this fires so the real envelope is captured.
- Prefer SambaNova model ids from the official catalog.
When it happens
Trigger: Calling the UnTooled (non-native) function-call chat path and SambaNova returns an object without a `choices` key, e.g. an error-shaped body, a model-not-found payload, or an empty {} from a gateway.
Common situations: Wrong or unsupported model id, an invalid/expired SAMBANOVA_LLM_API_KEY that SambaNova surfaces as a 200-with-error-body, or an upstream gateway returning a non-standard envelope.
Related errors
- SambaNova chat: No results length!
- Gemini: ${this.model} does not support tool calling.
- LMStudio must have a valid model set.
- OMLX must have a valid model set.
- SambaNova API key must be provided to use agents.
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/512f79ac474147cb.
Report an issue: GitHub.