| from pydantic import BaseModel, Field, validator, ValidationError |
| from typing import List, Dict, Any, Optional, Literal, Union |
| from enum import Enum |
|
|
| |
| |
| |
| |
| |
|
|
| class Treatment(BaseModel): |
| name: str = Field(..., title="Name", description="The treatment name") |
| description: str = Field(..., title="Description", description="The treatment description, including the conditions within this treatment") |
| crops: List[str] = Field(..., title="Crops", description="A list of crops being tested in this treatment") |
| fields: List[str] = Field(..., title="Fields", description="A list of fields in which this treatment has occured or will occur") |
| |
| |
| |
|
|
| class Trial(BaseModel): |
| name: str = Field(..., title="Name", description="The name of this trial") |
| description: str = Field(..., title="Description", description="A description of this trial") |
| treatments: List[Treatment] = Field(..., title="Treatments", description="A list of different treatments (strips or blocks with the same conditions applied) performed by the partner") |
|
|
| class TrialLite(BaseModel): |
| name: str = Field(..., title="Name", description="The name of this trial") |
| description: str = Field(..., title="Description", description="A description of this trial") |
| |
| |
|
|
| |
| class Role(str, Enum): |
| PARTNER = 'partner' |
| STAFF = 'staff' |
| AGRONOMIST = 'agronomist' |
| OTHER = 'other' |
| |
| class Person(BaseModel): |
| name: str = Field(..., title="Name", description="Name of this person") |
| role: Role = Field(..., title="Role", description="Role of this person") |
| |
| class Interactions(BaseModel): |
| people: List[Person] = Field(..., title="People", description="People involved or mentioned during interaction") |
| date: str = Field(..., title="Date of current interaction", description="Date of the interaction") |
| nextMeeting: str = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction") |
| nextSteps: List[str] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction") |
| summary: str = Field(..., title="Summary", description="Summary of the interaction") |
|
|
| class InteractionsLite(BaseModel): |
| date: str = Field(..., title="Date of current interaction", description="Date of the interaction") |
| nextMeeting: str = Field(..., title="Date of next meeting", description="Proposed date of the next future interaction") |
| nextSteps: List[str] = Field(..., title="Next Steps", description="List of individual next steps derived from the interaction") |
| summary: str = Field(..., title="Summary", description="Summary of the interaction") |
| |
| |
|
|
| |
| class Status(str, Enum): |
| ACTIVE = 'active' |
| ARCHIVED = 'archived' |
|
|
| |
| class Convention(str, Enum): |
| ACTIVITY = 'log--activity' |
| OBSERVATION = 'log--observation' |
| FLAMING = 'log--activity--flaming' |
| GRAZING = 'log--activity--grazing' |
| MOWING = 'log--activity--mowing' |
| SOLARIZATION = 'log--activity--solarization' |
| TERMINATION = 'log--activity--termination' |
| TILLAGE = 'log--activity--tillage' |
| HARVEST = 'log--activity--harvest' |
| HERBICIDE = 'log--input--herbicide_or_pesticide' |
| IRRIGATION = 'log--input--irrigation' |
| LIME = 'log--input--lime' |
| ORGANIC = 'log--input--organic_matter' |
| SEEDTREAT = 'log--input--seed_treatment' |
| SEEDLINGTREAT = 'log--input--seedling_treatment' |
| MODUS = 'log--lab_test--modus_lab_test' |
| SEEDING = 'log--seeding--seeding' |
| TRANSPLANT = 'log--transplanting--transplant' |
|
|
| class Structure(str, Enum): |
| CLAY = 'clay' |
| SANDYCLAY = 'sandy clay' |
| SILTYCLAY = 'silty clay' |
| SANDYCLAYLOAM = 'sandy clay loam' |
| SILYCLAMLOAM = 'silty clay loam' |
| CLAYLOAM = 'clay loam' |
| SANDYLOAM = 'sandy loam' |
| SILTLOAM = 'silt loam' |
| LOAM = 'loam' |
| LOAMYSAND = 'loamy sand' |
| SAND = 'sand' |
| SILT = 'silt' |
| |
| class Log(BaseModel): |
| convention: Convention = Field(..., title="Logs", description="This log's convention (i.e. this log's category or type)") |
| date: str = Field(..., title="Date", description="Date the log (i.e. action of the activity or input) was performed") |
| description: str = Field(..., title="Description", description="A description of the details of the log (i.e. details about farm activity performed") |
|
|
| class Soil(BaseModel): |
| description: str = Field(..., title="Description", description="A general description of the soil") |
| structure: List[Structure] = Field(..., title="Structure", description="The structure of the soil using options from the major soil texture classes (sand, clay, silt)") |
| biology: str = Field(..., title="Biology", description="Biological activity levels of the soil, including fluffiness, worms and bugs, and other evidence of soil biological activity") |
|
|
| class Yield(BaseModel): |
| quantity: str = Field(..., title="Quantity", description="A description of the total yield (harvested amount) from this planting, including units when available") |
| quality: str = Field(..., title="Quality", description="The product quality of the harvest. For example, small or large fruits, sweet or tart flavor, easily molding or containing mold, high number of product seconds, etc.)") |
|
|
| |
| class Planting(BaseModel): |
| name: str = Field(..., title="Name", description="The name of the planting") |
| status: Status = Field(..., title="Status", description="The status of the planting. \"active\" is a planting which is currently still in the field. \"archived\" is a planting which is no longer in the field (has been terminated or harvested)") |
| crop: List[str] = Field(..., title="Crop", description="A list of the crops in this planting") |
| variety: List[str] = Field(..., title="Variety", description="A list of the crop varieties in this planting") |
| logs: List[Log] = Field(..., title="Logs", description="A list of all the logs that are associated with the farm activities") |
| soil: List[Soil] = Field(..., title="Soil", description="A single soil profile for this planting, containing only one soil description") |
| yield_: List[Yield] = Field(..., title="Yield", description="One set of quantitative and qualitative yield observations for this planting") |
|
|
| class FarmActivities(BaseModel): |
| name: str = Field(..., title="Name", description="The name of the agricultural field.") |
| description: str = Field(..., title="Description", description="The description of the agricultural field.") |
| plantings: List[Planting] = Field(..., title="Plantings", description="All of the plantings which have occurred on this field.") |
|
|
| |
| class FarmActivitiesLite(BaseModel): |
| name: str = Field(..., title="Name", description="The name of the agricultural field.") |
| description: str = Field(..., title="Description", description="The description of the agricultural field.") |
| |
| class PlantingLite(BaseModel): |
| name: str = Field(..., title="Name", description="The name of the planting") |
| status: Status = Field(..., title="Status", description="The status of the planting. \"active\" is a planting which is currently still in the field. \"archived\" is a planting which is no longer in the field (has been terminated or harvested)") |
| crop: List[str] = Field(..., title="Crop", description="A list of the crops in this planting") |
| variety: List[str] = Field(..., title="Variety", description="A list of the crop varieties in this planting") |
| |