44from uuid import UUID
55
66from pydantic import BaseModel , Field , model_validator
7+ from rich .repr import Result
78
89from deepset_mcp .api .shared_models import DeepsetUser
910
@@ -41,6 +42,22 @@ class Config:
4142 datetime : lambda dt : dt .isoformat ()
4243 }
4344
45+ def __rich_repr__ (self ) -> Result :
46+ """Used to display the model in an LLM friendly way."""
47+ yield "name" , self .name
48+ yield "service_level" , self .service_level .value
49+ yield "status" , self .status
50+ yield "created_by" , f"{ self .created_by .given_name } { self .created_by .family_name } ({ self .created_by .id } )"
51+ yield "created_at" , self .created_at .strftime ("%m/%d/%Y %I:%M:%S %p" )
52+ yield (
53+ "last_updated_by" ,
54+ f"{ self .last_updated_by .given_name } { self .last_updated_by .family_name } ({ self .last_updated_by .id } )"
55+ if self .last_updated_by
56+ else None ,
57+ )
58+ yield "last_updated_at" , self .last_updated_at .strftime ("%m/%d/%Y %I:%M:%S %p" ) if self .last_updated_at else None
59+ yield "yaml_config" , self .yaml_config if self .yaml_config is not None else "Get full pipeline to see config."
60+
4461
4562class ValidationError (BaseModel ):
4663 """Model representing a validation error from the pipeline validation API."""
@@ -55,6 +72,11 @@ class PipelineValidationResult(BaseModel):
5572 valid : bool
5673 errors : list [ValidationError ] = []
5774
75+ def __rich_repr__ (self ) -> Result :
76+ """Used to display the model in an LLM friendly way."""
77+ yield "valid" , self .valid
78+ yield "errors" , [f"{ e .message } ({ e .code } )" for e in self .errors ]
79+
5880
5981class TraceFrame (BaseModel ):
6082 """Model representing a single frame in a stack trace."""
0 commit comments