Skip to main content
Glama
models.py4.55 kB
""" Pydantic models for structured critique and synthesis responses. This module defines the data models used for the thinking augmentation system, including input requests and structured responses from both critique agents and the synthesis agent. """ from typing import Literal from pydantic import BaseModel, Field CritiquePerspective = Literal["positive", "neutral", "negative"] class CritiqueRequest(BaseModel): """Request model for critique analysis.""" proposal: str = Field( ..., description="Markdown-formatted proposal outlining the salient points of the " "solution", min_length=10, ) class CritiqueAnalysis(BaseModel): """Structured analysis component of a critique.""" feasibility: str = Field( ..., description="Assessment of how realistic and achievable the proposal is" ) risks: str = Field( ..., description="Identification and evaluation of potential risks or challenges", ) benefits: str = Field( ..., description="Analysis of potential advantages and positive outcomes" ) implementation: str = Field( ..., description="Considerations around how the proposal could be executed" ) stakeholder_impact: str = Field( ..., description="Analysis of how different stakeholders would be affected" ) resource_requirements: str = Field( ..., description="Assessment of resources (time, money, personnel) needed" ) class CritiqueResponse(BaseModel): """Structured response from a critique agent.""" perspective: CritiquePerspective = Field( ..., description="The perspective this critique represents" ) executive_summary: str = Field( ..., description="Brief 2-3 sentence summary of the overall critique" ) analysis: CritiqueAnalysis = Field( ..., description="Detailed structured analysis of the proposal" ) key_insights: list[str] = Field( ..., description="3-5 key insights or observations from this perspective", min_length=3, max_length=5, ) confidence_level: float = Field( ..., description="Confidence in this critique's validity (0.0 to 1.0)", ge=0.0, le=1.0, ) class ConsensusView(BaseModel): """Consensus analysis synthesized from all critiques.""" areas_of_agreement: list[str] = Field( ..., description="Points where all perspectives align or largely agree" ) areas_of_disagreement: list[str] = Field( ..., description="Points where perspectives significantly diverge" ) balanced_assessment: str = Field( ..., description="Balanced view considering all perspectives on key aspects" ) critical_considerations: list[str] = Field( ..., description="The most important factors to consider based on all critiques" ) class SynthesisResponse(BaseModel): """Final synthesis response combining all critique perspectives.""" executive_summary: str = Field( ..., description="High-level summary of the synthesis and recommendation" ) consensus_view: ConsensusView = Field( ..., description="Synthesized consensus from all critique perspectives" ) recommendation: str = Field( ..., description="Overall recommendation based on the analysis" ) next_steps: list[str] = Field( ..., description="Suggested concrete next steps or actions", min_length=1 ) uncertainty_flags: list[str] = Field( default_factory=list, description="Areas where there is significant uncertainty or need for more " "information", ) overall_confidence: float = Field( ..., description="Overall confidence in the synthesis (0.0 to 1.0)", ge=0.0, le=1.0, ) class ThinkingAugmentationResult(BaseModel): """Complete result from the thinking augmentation process.""" original_proposal: str = Field( ..., description="The original proposal that was analyzed" ) critiques: list[CritiqueResponse] = Field( ..., description="All critique responses (positive, neutral, negative)", min_length=3, max_length=3, ) synthesis: SynthesisResponse = Field( ..., description="Final synthesis of all perspectives" ) processing_metadata: dict = Field( default_factory=dict, description="Metadata about the processing (timestamps, model versions, etc.)", )

Implementation Reference

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dogonthehorizon/elrond-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server