Interface DocumentBlock.Builder

  • Method Details

    • format

      DocumentBlock.Builder format(String format)

      The format of a document, or its extension.

      Parameters:
      format - The format of a document, or its extension.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • format

      The format of a document, or its extension.

      Parameters:
      format - The format of a document, or its extension.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • name

      A name for the document. The name can only contain the following characters:

      • Alphanumeric characters

      • Whitespace characters (no more than one in a row)

      • Hyphens

      • Parentheses

      • Square brackets

      This field is vulnerable to prompt injections, because the model might inadvertently interpret it as instructions. Therefore, we recommend that you specify a neutral name.

      Parameters:
      name - A name for the document. The name can only contain the following characters:

      • Alphanumeric characters

      • Whitespace characters (no more than one in a row)

      • Hyphens

      • Parentheses

      • Square brackets

      This field is vulnerable to prompt injections, because the model might inadvertently interpret it as instructions. Therefore, we recommend that you specify a neutral name.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • source

      Contains the content of the document.

      Parameters:
      source - Contains the content of the document.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • source

      Contains the content of the document.

      This is a convenience method that creates an instance of the DocumentSource.Builder avoiding the need to create one manually via DocumentSource.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to source(DocumentSource).

      Parameters:
      source - a consumer that will call methods on DocumentSource.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • context

      DocumentBlock.Builder context(String context)

      Contextual information about how the document should be processed or interpreted by the model when generating citations.

      Parameters:
      context - Contextual information about how the document should be processed or interpreted by the model when generating citations.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • citations

      DocumentBlock.Builder citations(CitationsConfig citations)

      Configuration settings that control how citations should be generated for this specific document.

      Parameters:
      citations - Configuration settings that control how citations should be generated for this specific document.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • citations

      default DocumentBlock.Builder citations(Consumer<CitationsConfig.Builder> citations)

      Configuration settings that control how citations should be generated for this specific document.

      This is a convenience method that creates an instance of the CitationsConfig.Builder avoiding the need to create one manually via CitationsConfig.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to citations(CitationsConfig).

      Parameters:
      citations - a consumer that will call methods on CitationsConfig.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: