Prompt Setup

pydantic model ibm_watsonx_gov.entities.prompt_setup.PromptSetup

Bases: BaseModel

Show JSON schema
{
   "title": "PromptSetup",
   "type": "object",
   "properties": {
      "task_type": {
         "$ref": "#/$defs/TaskType",
         "description": "Prompt task type",
         "examples": [
            "retrieval_augmented_generation",
            "classification"
         ]
      },
      "question_field": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Question column name from the input",
         "examples": [
            "question"
         ],
         "title": "Question Field"
      },
      "context_fields": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of context column names from the input",
         "examples": [
            [
               "context1",
               "context2"
            ]
         ],
         "title": "Context Fields"
      },
      "prediction_field": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "generated_text",
         "description": "Prediction field name from the input",
         "examples": [
            "generated_text"
         ],
         "title": "Prediction Field"
      },
      "label_column": {
         "description": "reference output column name",
         "examples": [
            "answer",
            "ground_truth"
         ],
         "title": "Label Column",
         "type": "string"
      },
      "input_data_type": {
         "$ref": "#/$defs/InputDataType",
         "default": "unstructured_text",
         "description": "Prompt input data type",
         "examples": [
            "unstructured_text",
            "structured"
         ]
      }
   },
   "$defs": {
      "InputDataType": {
         "description": "Supported input data types",
         "enum": [
            "structured",
            "unstructured_text",
            "unstructured_image",
            "multimodal"
         ],
         "title": "InputDataType",
         "type": "string"
      },
      "TaskType": {
         "description": "Supported task types for generative AI models",
         "enum": [
            "question_answering",
            "classification",
            "summarization",
            "generation",
            "extraction",
            "retrieval_augmented_generation"
         ],
         "title": "TaskType",
         "type": "string"
      }
   },
   "required": [
      "task_type",
      "label_column"
   ]
}

Config:
  • arbitrary_types_allowed: bool = True

Fields:
Validators:
field context_fields: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=True, description='List of context column names from the input', examples=[['context1', 'context2']])] = None

List of context column names from the input

Validated by:
field input_data_type: STRUCTURED: 'structured'>])] = InputDataType.TEXT

Prompt input data type

Validated by:
field label_column: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='reference output column name', examples=['answer', 'ground_truth'])] [Required]

reference output column name

Validated by:
field prediction_field: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default='generated_text', description='Prediction field name from the input', examples=['generated_text'])] = 'generated_text'

Prediction field name from the input

Validated by:
field question_field: Annotated[str | None, FieldInfo(annotation=NoneType, required=True, description='Question column name from the input', examples=['question'])] = None

Question column name from the input

Validated by:
field task_type: CLASSIFICATION: 'classification'>])] [Required]

Prompt task type

Validated by:
validator require_context_and_question_columns_for_rag  »  all fields