Question¶

pydantic model schemas.question.QuestionBase¶

Base class for Question

Show JSON schema
{
   "title": "QuestionBase",
   "description": "Base class for Question",
   "type": "object",
   "properties": {
      "language": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Language"
      },
      "tag": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tag"
      },
      "text": {
         "title": "Text",
         "type": "string"
      },
      "url": {
         "title": "Url",
         "type": "string"
      }
   },
   "required": [
      "text",
      "url"
   ]
}

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field language: str | None = None¶

Language of the question and answer text

field tag: str | None = None¶

Tag of the document text

field text: str [Required]¶

Content of the question

field url: str [Required]¶

URL where the question-answer was found

pydantic model schemas.question.QuestionCreate¶

Create class for Question

Show JSON schema
{
   "title": "QuestionCreate",
   "description": "Create class for Question",
   "type": "object",
   "properties": {
      "language": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Language"
      },
      "tag": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tag"
      },
      "text": {
         "title": "Text",
         "type": "string"
      },
      "url": {
         "title": "Url",
         "type": "string"
      },
      "answer": {
         "title": "Answer",
         "type": "string"
      },
      "embedding": {
         "anyOf": [
            {
               "items": {
                  "type": "number"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Embedding"
      },
      "source": {
         "title": "Source",
         "type": "string"
      }
   },
   "required": [
      "text",
      "url",
      "answer",
      "source"
   ]
}

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field answer: str [Required]¶

Text of the answer to the question

field embedding: list[float] | None = None¶
field language: str | None = None¶

Language of the question and answer text

field source: str [Required]¶

How the question-answer was found, can be a URL or a file path for example

field tag: str | None = None¶

Tag of the document text

field text: str [Required]¶

Content of the question

field url: str [Required]¶

URL where the question-answer was found

pydantic model schemas.question.QuestionsCreate¶

Create class for Question

Show JSON schema
{
   "title": "QuestionsCreate",
   "description": "Create class for Question",
   "type": "object",
   "properties": {
      "objects": {
         "items": {
            "$ref": "#/$defs/QuestionCreate"
         },
         "title": "Objects",
         "type": "array"
      }
   },
   "$defs": {
      "QuestionCreate": {
         "description": "Create class for Question",
         "properties": {
            "language": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Language"
            },
            "tag": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Tag"
            },
            "text": {
               "title": "Text",
               "type": "string"
            },
            "url": {
               "title": "Url",
               "type": "string"
            },
            "answer": {
               "title": "Answer",
               "type": "string"
            },
            "embedding": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Embedding"
            },
            "source": {
               "title": "Source",
               "type": "string"
            }
         },
         "required": [
            "text",
            "url",
            "answer",
            "source"
         ],
         "title": "QuestionCreate",
         "type": "object"
      }
   },
   "required": [
      "objects"
   ]
}

Fields:
field objects: list[QuestionCreate] [Required]¶

A list of questions to add to the database

pydantic model schemas.question.QuestionItem¶

Upsert class for Question in Survey Pipeline

Show JSON schema
{
   "title": "QuestionItem",
   "description": "Upsert class for Question in Survey Pipeline",
   "type": "object",
   "properties": {
      "language": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Language"
      },
      "tag": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tag"
      },
      "text": {
         "title": "Text",
         "type": "string"
      },
      "url": {
         "title": "Url",
         "type": "string"
      },
      "answer": {
         "title": "Answer",
         "type": "string"
      },
      "embedding": {
         "anyOf": [
            {
               "items": {
                  "type": "number"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Embedding"
      },
      "source": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Source"
      },
      "id": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Id"
      }
   },
   "required": [
      "text",
      "url",
      "answer"
   ]
}

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field answer: str [Required]¶

Text of the answer to the question

field embedding: list[float] | None = None¶
field id: int | None = None¶
field language: str | None = None¶

Language of the question and answer text

field source: str | None = None¶

How the question-answer was found, can be a URL or a file path for example

field tag: str | None = None¶

Tag of the document text

field text: str [Required]¶

Content of the question

field url: str [Required]¶

URL where the question-answer was found

pydantic model schemas.question.QuestionUpdate¶

Update class for Question

Show JSON schema
{
   "title": "QuestionUpdate",
   "description": "Update class for Question",
   "type": "object",
   "properties": {
      "language": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Language"
      },
      "tag": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tag"
      },
      "text": {
         "title": "Text",
         "type": "string"
      },
      "url": {
         "title": "Url",
         "type": "string"
      },
      "source_id": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Source Id"
      },
      "embedding": {
         "anyOf": [
            {
               "items": {
                  "type": "number"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Embedding"
      }
   },
   "required": [
      "text",
      "url"
   ]
}

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field embedding: list[float] | None = None¶
field language: str | None = None¶

Language of the question and answer text

field source_id: int | None = None¶
field tag: str | None = None¶

Tag of the document text

field text: str [Required]¶

Content of the question

field url: str [Required]¶

URL where the question-answer was found

pydantic model schemas.question.Question¶

Show JSON schema
{
   "title": "Question",
   "type": "object",
   "properties": {
      "language": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Language"
      },
      "tag": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tag"
      },
      "text": {
         "title": "Text",
         "type": "string"
      },
      "url": {
         "title": "Url",
         "type": "string"
      },
      "id": {
         "title": "Id",
         "type": "integer"
      },
      "answer": {
         "$ref": "#/$defs/DocumentBase"
      }
   },
   "$defs": {
      "DocumentBase": {
         "description": "Base class for Document",
         "properties": {
            "language": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Language"
            },
            "tag": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Tag"
            },
            "text": {
               "title": "Text",
               "type": "string"
            },
            "url": {
               "title": "Url",
               "type": "string"
            }
         },
         "required": [
            "text",
            "url"
         ],
         "title": "DocumentBase",
         "type": "object"
      }
   },
   "required": [
      "text",
      "url",
      "id",
      "answer"
   ]
}

Config:
  • arbitrary_types_allowed: bool = True

  • from_attributes: bool = True

Fields:
field answer: DocumentBase [Required]¶

Related answer from Document table

field id: int [Required]¶
field language: str | None = None¶

Language of the question and answer text

field tag: str | None = None¶

Tag of the document text

field text: str [Required]¶

Content of the question

field url: str [Required]¶

URL where the question-answer was found