package com.chatgpt.example.dto.request;

import com.theokanning.openai.completion.CompletionRequest;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class GPTCompletionRequest {

  private String model;

  private String prompt;

  private Integer maxToken;


  public static CompletionRequest of(GPTCompletionRequest restRequest) {
    return CompletionRequest.builder()
        .model(restRequest.getModel())
        .prompt(restRequest.getPrompt())
        .maxTokens(restRequest.getMaxToken())
        .build();
  }
}

com.theokanning.openai.completion.CompletionRequest.builder
[((441, 611), 'com.theokanning.openai.completion.CompletionRequest.builder'), ((441, 594), 'com.theokanning.openai.completion.CompletionRequest.builder'), ((441, 548), 'com.theokanning.openai.completion.CompletionRequest.builder'), ((441, 507), 'com.theokanning.openai.completion.CompletionRequest.builder')]