Class UserPromptSubmittedHookInput

java.lang.Object
com.github.copilot.sdk.json.UserPromptSubmittedHookInput

public class UserPromptSubmittedHookInput extends Object
Input for a user-prompt-submitted hook.

This hook is invoked when the user submits a prompt, allowing you to intercept and modify the prompt before it is processed.

Since:
1.0.7
  • Constructor Details

    • UserPromptSubmittedHookInput

      public UserPromptSubmittedHookInput()
  • Method Details

    • getTimestamp

      public long getTimestamp()
      Gets the timestamp when the prompt was submitted.
      Returns:
      the timestamp in milliseconds since epoch
    • setTimestamp

      public UserPromptSubmittedHookInput setTimestamp(long timestamp)
      Sets the timestamp when the prompt was submitted.
      Parameters:
      timestamp - the timestamp in milliseconds since epoch
      Returns:
      this instance for method chaining
    • getCwd

      public String getCwd()
      Gets the current working directory.
      Returns:
      the current working directory
    • setCwd

      public UserPromptSubmittedHookInput setCwd(String cwd)
      Sets the current working directory.
      Parameters:
      cwd - the current working directory
      Returns:
      this instance for method chaining
    • getPrompt

      public String getPrompt()
      Gets the user's prompt.
      Returns:
      the prompt text
    • setPrompt

      public UserPromptSubmittedHookInput setPrompt(String prompt)
      Sets the user's prompt.
      Parameters:
      prompt - the prompt text
      Returns:
      this instance for method chaining