Source¶

pydantic model schemas.source.SourceBase¶

Base class for Source

Show JSON schema
{
   "title": "SourceBase",
   "description": "Base class for Source",
   "type": "object",
   "properties": {
      "url": {
         "title": "Url",
         "type": "string"
      }
   },
   "required": [
      "url"
   ]
}

Fields:
field url: str [Required]¶

Not necessarily a URL, but a string that identifies the source. Can be a pathfile or a user ID for example.

pydantic model schemas.source.SourceCreate¶

Create class for Source

Show JSON schema
{
   "title": "SourceCreate",
   "description": "Create class for Source",
   "type": "object",
   "properties": {
      "url": {
         "title": "Url",
         "type": "string"
      }
   },
   "required": [
      "url"
   ]
}

Fields:
field url: str [Required]¶

Not necessarily a URL, but a string that identifies the source. Can be a pathfile or a user ID for example.

pydantic model schemas.source.Source¶

Class for Source

Show JSON schema
{
   "title": "Source",
   "description": "Class for Source",
   "type": "object",
   "properties": {
      "url": {
         "title": "Url",
         "type": "string"
      },
      "id": {
         "title": "Id",
         "type": "integer"
      },
      "questions": {
         "default": [],
         "items": {
            "$ref": "#/$defs/QuestionBase"
         },
         "title": "Questions",
         "type": "array"
      },
      "documents": {
         "default": [],
         "items": {
            "$ref": "#/$defs/DocumentBase"
         },
         "title": "Documents",
         "type": "array"
      }
   },
   "$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"
      },
      "QuestionBase": {
         "description": "Base 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"
            }
         },
         "required": [
            "text",
            "url"
         ],
         "title": "QuestionBase",
         "type": "object"
      }
   },
   "required": [
      "url",
      "id"
   ]
}

Config:
  • from_attributes: bool = True

Fields:
field documents: list[DocumentBase] = []¶

A list of documents from this source

field id: int [Required]¶
field questions: list[QuestionBase] = []¶

A list of questions from this source

field url: str [Required]¶

Not necessarily a URL, but a string that identifies the source. Can be a pathfile or a user ID for example.