Data Models¶
Core data models used throughout GeoAgent for structured data exchange between agents.
geoagent.core.models
¶
Shared Pydantic models for GeoAgent components.
This module contains all shared data models used across the GeoAgent pipeline to avoid circular dependencies between modules.
AnalysisResult (BaseModel)
¶
Result from the Analysis Agent containing computed analysis.
Source code in geoagent/core/models.py
class AnalysisResult(BaseModel):
"""Result from the Analysis Agent containing computed analysis."""
result_data: Union[Dict[str, Any], List[Any]] = Field(
description="The computed analysis results (summary statistics, arrays, etc.)"
)
code_generated: str = Field(
description="Python code that was generated and executed for transparency"
)
visualization_hints: Dict[str, Any] = Field(
default_factory=dict,
description="Suggested visualization parameters (colormap, ranges, etc.)",
)
success: bool = Field(
default=True, description="Whether the analysis completed successfully"
)
error_message: Optional[str] = Field(
default=None, description="Error message if analysis failed"
)
__class_vars__
special
¶
The names of the class variables defined on the model.
__private_attributes__
special
¶
Metadata about the private attributes of the model.
__pydantic_complete__
special
¶
Whether model building is completed, or if there are still undefined fields.
__pydantic_computed_fields__
special
¶
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_custom_init__
special
¶
Whether the model has a custom __init__ method.
__pydantic_decorators__
special
¶
Metadata containing the decorators defined on the model.
This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_fields__
special
¶
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
__pydantic_generic_metadata__
special
¶
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
special
¶
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
special
¶
The name of the post-init method for the model, if defined.
__pydantic_setattr_handlers__
special
¶
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
__signature__
special
¶
The synthesized __init__ [Signature][inspect.Signature] of the model.
model_config
¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
DataResult (BaseModel)
¶
Result from the Data Agent containing retrieved geospatial data.
Source code in geoagent/core/models.py
class DataResult(BaseModel):
"""Result from the Data Agent containing retrieved geospatial data."""
items: List[Dict[str, Any]] = Field(
description="List of STAC items or data references"
)
metadata: Dict[str, Any] = Field(
default_factory=dict, description="Additional metadata about the data search"
)
data_type: str = Field(
description="Type of data retrieved: 'raster', 'vector', or 'tabular'"
)
total_items: int = Field(description="Total number of items found")
search_query: Optional[Dict[str, Any]] = Field(
default=None, description="The search query that was executed"
)
__class_vars__
special
¶
The names of the class variables defined on the model.
__private_attributes__
special
¶
Metadata about the private attributes of the model.
__pydantic_complete__
special
¶
Whether model building is completed, or if there are still undefined fields.
__pydantic_computed_fields__
special
¶
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_custom_init__
special
¶
Whether the model has a custom __init__ method.
__pydantic_decorators__
special
¶
Metadata containing the decorators defined on the model.
This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_fields__
special
¶
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
__pydantic_generic_metadata__
special
¶
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
special
¶
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
special
¶
The name of the post-init method for the model, if defined.
__pydantic_setattr_handlers__
special
¶
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
__signature__
special
¶
The synthesized __init__ [Signature][inspect.Signature] of the model.
model_config
¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
GeoAgentResponse (BaseModel)
¶
Complete response from GeoAgent containing all pipeline results.
Source code in geoagent/core/models.py
class GeoAgentResponse(BaseModel):
"""Complete response from GeoAgent containing all pipeline results."""
plan: PlannerOutput = Field(description="The parsed query plan")
data: Optional[DataResult] = Field(
default=None, description="Data retrieval results"
)
analysis: Optional[AnalysisResult] = Field(
default=None, description="Analysis results if analysis was performed"
)
map: Optional[Any] = Field( # leafmap.Map - using Any to avoid import issues
default=None, description="Generated leafmap visualization"
)
code: str = Field(
default="", description="All generated Python code from the pipeline"
)
success: bool = Field(
default=True, description="Whether the overall pipeline succeeded"
)
error_message: Optional[str] = Field(
default=None, description="Error message if pipeline failed"
)
execution_time: Optional[float] = Field(
default=None, description="Total execution time in seconds"
)
__class_vars__
special
¶
The names of the class variables defined on the model.
__private_attributes__
special
¶
Metadata about the private attributes of the model.
__pydantic_complete__
special
¶
Whether model building is completed, or if there are still undefined fields.
__pydantic_computed_fields__
special
¶
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_custom_init__
special
¶
Whether the model has a custom __init__ method.
__pydantic_decorators__
special
¶
Metadata containing the decorators defined on the model.
This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_fields__
special
¶
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
__pydantic_generic_metadata__
special
¶
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
special
¶
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
special
¶
The name of the post-init method for the model, if defined.
__pydantic_setattr_handlers__
special
¶
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
__signature__
special
¶
The synthesized __init__ [Signature][inspect.Signature] of the model.
model_config
¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Intent (str, Enum)
¶
Supported query intents.
Source code in geoagent/core/models.py
class Intent(str, Enum):
"""Supported query intents."""
SEARCH = "search"
ANALYZE = "analyze"
VISUALIZE = "visualize"
COMPARE = "compare"
__format__(self, format_spec)
special
¶
Default object formatter.
Return str(self) if format_spec is empty. Raise TypeError otherwise.
Source code in geoagent/core/models.py
def __format__(self, format_spec):
return str.__format__(str(self), format_spec)
PlannerOutput (BaseModel)
¶
Output from the Planner Agent containing structured query parameters.
Source code in geoagent/core/models.py
class PlannerOutput(BaseModel):
"""Output from the Planner Agent containing structured query parameters."""
intent: str = Field(
description="The analysis intent (e.g., 'compute_ndvi', 'find_deforestation')"
)
location: Optional[Dict[str, Any]] = Field(
default=None,
description="Location information (bounding box, geometry, place name)",
)
time_range: Optional[Dict[str, Union[str, datetime]]] = Field(
default=None, description="Temporal range with start_date and end_date"
)
dataset: Optional[str] = Field(
default=None,
description="Preferred dataset or catalog (e.g., 'sentinel-2', 'landsat')",
)
analysis_type: Optional[str] = Field(
default=None,
description="Type of analysis requested (e.g., 'ndvi', 'change_detection')",
)
parameters: Dict[str, Any] = Field(
default_factory=dict, description="Additional analysis parameters"
)
confidence: float = Field(
default=1.0, description="Confidence score of the parsing (0-1)"
)
__class_vars__
special
¶
The names of the class variables defined on the model.
__private_attributes__
special
¶
Metadata about the private attributes of the model.
__pydantic_complete__
special
¶
Whether model building is completed, or if there are still undefined fields.
__pydantic_computed_fields__
special
¶
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_custom_init__
special
¶
Whether the model has a custom __init__ method.
__pydantic_decorators__
special
¶
Metadata containing the decorators defined on the model.
This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_fields__
special
¶
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
__pydantic_generic_metadata__
special
¶
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
special
¶
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
special
¶
The name of the post-init method for the model, if defined.
__pydantic_setattr_handlers__
special
¶
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
__signature__
special
¶
The synthesized __init__ [Signature][inspect.Signature] of the model.
model_config
¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].