fix warning
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# danistay_mcp_module/models.py
|
||||
|
||||
from pydantic import BaseModel, Field, HttpUrl
|
||||
from pydantic import BaseModel, Field, HttpUrl, ConfigDict
|
||||
from typing import List, Optional, Dict, Any
|
||||
|
||||
class DanistayBaseSearchRequest(BaseModel):
|
||||
@@ -76,7 +76,7 @@ class DanistayApiDecisionEntry(BaseModel):
|
||||
id: str
|
||||
# The API response for keyword search uses "daireKurul", detailed search example uses "daire".
|
||||
# We use an alias to handle both and map to a consistent field name "chamber".
|
||||
chamber: Optional[str] = Field(None, alias="daire", alt_alias="daireKurul", description="The chamber or board.")
|
||||
chamber: Optional[str] = Field(None, alias="daire", description="The chamber or board.")
|
||||
esasNo: Optional[str] = Field(None)
|
||||
kararNo: Optional[str] = Field(None)
|
||||
kararTarihi: Optional[str] = Field(None)
|
||||
@@ -86,9 +86,7 @@ class DanistayApiDecisionEntry(BaseModel):
|
||||
|
||||
document_url: Optional[HttpUrl] = Field(None, description="URL (Belge URL) to the full document, constructed by the client.")
|
||||
|
||||
class Config:
|
||||
populate_by_name = True # Important for alias to work
|
||||
extra = 'ignore' # Ignore any extra fields from API not defined in model
|
||||
model_config = ConfigDict(populate_by_name=True, extra='ignore') # Important for alias to work and ignore extra fields
|
||||
|
||||
class DanistayApiResponseInnerData(BaseModel):
|
||||
"""Model for the inner 'data' object in the Danistay API search response."""
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# emsal_mcp_module/models.py
|
||||
|
||||
from pydantic import BaseModel, Field, HttpUrl
|
||||
from pydantic import BaseModel, Field, HttpUrl, ConfigDict
|
||||
from typing import List, Optional, Dict, Any
|
||||
|
||||
class EmsalDetailedSearchRequestData(BaseModel):
|
||||
@@ -32,9 +32,7 @@ class EmsalDetailedSearchRequestData(BaseModel):
|
||||
pageSize: int
|
||||
pageNumber: int
|
||||
|
||||
class Config:
|
||||
populate_by_name = True # Enables use of alias in serialization (when dumping to dict for payload)
|
||||
# anystr_strip_whitespace = True # Optional: strip whitespace from strings
|
||||
model_config = ConfigDict(populate_by_name=True) # Enables use of alias in serialization (when dumping to dict for payload)
|
||||
|
||||
class EmsalSearchRequest(BaseModel): # This is the model the MCP tool will accept
|
||||
"""Model for Emsal detailed search request, with user-friendly field names."""
|
||||
@@ -75,8 +73,7 @@ class EmsalApiDecisionEntry(BaseModel):
|
||||
|
||||
document_url: Optional[HttpUrl] = Field(None, description="URL (Belge URL) to the full document, constructed by the client.")
|
||||
|
||||
class Config:
|
||||
extra = 'ignore'
|
||||
model_config = ConfigDict(extra='ignore')
|
||||
|
||||
class EmsalApiResponseInnerData(BaseModel):
|
||||
"""Model for the inner 'data' object in the Emsal API search response."""
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# kik_mcp_module/models.py
|
||||
from pydantic import BaseModel, Field, HttpUrl, computed_field
|
||||
from pydantic import BaseModel, Field, HttpUrl, computed_field, ConfigDict
|
||||
from typing import List, Optional
|
||||
from enum import Enum
|
||||
import base64 # Base64 encoding/decoding için
|
||||
@@ -46,8 +46,7 @@ class KikDecisionEntry(BaseModel):
|
||||
combined_key = f"{self.karar_tipi.value}|{self.karar_no_str}"
|
||||
return base64.b64encode(combined_key.encode('utf-8')).decode('utf-8')
|
||||
|
||||
class Config:
|
||||
populate_by_name = True
|
||||
model_config = ConfigDict(populate_by_name=True)
|
||||
|
||||
class KikSearchResult(BaseModel):
|
||||
"""Model for KIK search results."""
|
||||
@@ -73,5 +72,4 @@ class KikDocumentMarkdown(BaseModel):
|
||||
is_paginated: bool = Field(False, description="True if the full markdown content is split into multiple pages.")
|
||||
full_content_char_count: Optional[int] = Field(None, description="Total character count of the full markdown content before chunking.")
|
||||
|
||||
class Config:
|
||||
populate_by_name = True
|
||||
model_config = ConfigDict(populate_by_name=True)
|
||||
@@ -1,6 +1,6 @@
|
||||
# yargitay_mcp_module/models.py
|
||||
|
||||
from pydantic import BaseModel, Field, HttpUrl
|
||||
from pydantic import BaseModel, Field, HttpUrl, ConfigDict
|
||||
from typing import List, Optional, Dict, Any, Literal
|
||||
|
||||
# Yargıtay Chamber/Board Options
|
||||
@@ -115,8 +115,7 @@ class YargitayApiDecisionEntry(BaseModel):
|
||||
# This field will be populated by the client after fetching the search list
|
||||
document_url: Optional[HttpUrl] = Field(None, description="Direct URL (Belge URL) to the decision document.")
|
||||
|
||||
class Config:
|
||||
populate_by_name = True # To allow populating by alias from API response
|
||||
model_config = ConfigDict(populate_by_name=True) # To allow populating by alias from API response
|
||||
|
||||
|
||||
class YargitayApiResponseInnerData(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user