Documentation
    Preparing search index...

    Function parseLlmProviderResponse

    • Map a provider JSON response to a NAP-LLM Generation.

      Parameters

      • protocol: LlmProviderProtocol

        Dialect the response came from.

      • json: unknown

        Parsed response body.

      Returns LlmGeneration

      Text, finish reason and usage when reported.

      LlmServiceError provider-error for missing completion markers; the message never echoes the body.

      const generation = parseLlmProviderResponse('openai-chat', await response.json());