Map a provider JSON response to a NAP-LLM Generation.
Dialect the response came from.
Parsed response body.
Text, finish reason and usage when reported.
LlmServiceError provider-error for missing completion markers; the message never echoes the body.
provider-error
const generation = parseLlmProviderResponse('openai-chat', await response.json()); Copy
const generation = parseLlmProviderResponse('openai-chat', await response.json());
Map a provider JSON response to a NAP-LLM Generation.