LLM response undefined in Typescript Code Repository

Hi @andr3wV.

I can think of a few scenarios:

  1. Empty Input Prompt: If the input prompt is an empty string, the function will return null.

  2. Prompt Exceeding Model Limits: When the input prompt surpasses the model’s context length limits, the function cannot process it and returns null.

(Seen while using PB)

  1. Rate Limiting by LLM Provider: If the LLM provider enforces rate limits, some rows may not be processed, leading to null outputs for those rows. This can occur even after multiple retries. Palantir Community

  2. Output Type Coercion Failures: When the LLM’s response cannot be coerced into the specified output type, the function may return null. This often happens if the response format doesn’t match the expected structure. Palantir Community

Not applicable, but good to know:

  1. Missing Prompt with Only Media Reference: Providing only a media reference without an accompanying prompt results in a null output, as the function requires a textual prompt to operate. Palantir

To diagnose and address these issues, consider a toy example for the user promptt and start but not trying to coerce the response. Here