Class GPULlama3ResponseParser

java.lang.Object
dev.langchain4j.model.gpullama3.GPULlama3ResponseParser

@Deprecated(since="1.21.0-beta31") public class GPULlama3ResponseParser extends Object
Deprecated.
GPULlama3.java has been succeeded by jitLLM. There is no replacement for this class: dev.langchain4j.model.jitllm.JitLLMChatModel and dev.langchain4j.model.jitllm.JitLLMStreamingChatModel from the langchain4j-jitllm module separate the thinking themselves and return it when returnThinking(true) is set.
Utility class for parsing GPULlama3 model responses that contain thinking content.

GPULlama3 models can generate responses with embedded thinking content in the format: <think>thinking content...</think>actual response content

This parser separates the thinking content from the actual response content for both complete responses and streaming responses, while preserving the thinking tags.

  • Method Details

    • parseResponse

      public static GPULlama3ResponseParser.ParsedResponse parseResponse(String rawResponse)
      Deprecated.
      Parses a raw GPULlama3 response to separate thinking content from actual response. Preserves the thinking tags in the thinking content.
      Parameters:
      rawResponse - the raw response from the model
      Returns:
      ParsedResponse containing separated thinking and response content
      Throws:
      IllegalArgumentException - if rawResponse is null
    • extractThinking

      public static String extractThinking(String rawResponse)
      Deprecated.
      Convenience method to extract only the thinking content from a response. Returns thinking content with tags preserved.
      Parameters:
      rawResponse - the raw response from the model
      Returns:
      the thinking content with tags, or null if none found
    • extractResponse

      public static String extractResponse(String rawResponse)
      Deprecated.
      Convenience method to extract only the cleaned response content.
      Parameters:
      rawResponse - the raw response from the model
      Returns:
      the response content with thinking tags removed
    • createStreamingParser

      public static GPULlama3ResponseParser.StreamingParser createStreamingParser(StreamingChatResponseHandler handler, org.beehive.gpullama3.model.Model model)
      Deprecated.
      Creates a new streaming parser for real-time thinking content separation.
      Parameters:
      handler - the streaming response handler
      model - the GPULlama3 model instance for token decoding
      Returns:
      a new StreamingThinkingParser instance