refactor: use snake case instead of camel case in types (#1894)
This commit is contained in:
parent
7080fcf1e6
commit
e94b386a13
3 changed files with 1063 additions and 1057 deletions
|
|
@ -305,8 +305,8 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
name=info.name,
|
||||
title=info.title,
|
||||
description=info.description,
|
||||
inputSchema=info.parameters,
|
||||
outputSchema=info.output_schema,
|
||||
input_schema=info.parameters,
|
||||
output_schema=info.output_schema,
|
||||
annotations=info.annotations,
|
||||
icons=info.icons,
|
||||
_meta=info.meta,
|
||||
|
|
@ -340,7 +340,7 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
name=resource.name or "",
|
||||
title=resource.title,
|
||||
description=resource.description,
|
||||
mimeType=resource.mime_type,
|
||||
mime_type=resource.mime_type,
|
||||
icons=resource.icons,
|
||||
annotations=resource.annotations,
|
||||
_meta=resource.meta,
|
||||
|
|
@ -352,11 +352,11 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
templates = self._resource_manager.list_templates()
|
||||
return [
|
||||
MCPResourceTemplate(
|
||||
uriTemplate=template.uri_template,
|
||||
uri_template=template.uri_template,
|
||||
name=template.name,
|
||||
title=template.title,
|
||||
description=template.description,
|
||||
mimeType=template.mime_type,
|
||||
mime_type=template.mime_type,
|
||||
icons=template.icons,
|
||||
annotations=template.annotations,
|
||||
_meta=template.meta,
|
||||
|
|
@ -1104,7 +1104,7 @@ class Context(BaseModel, Generic[ServerSessionT, LifespanContextT, RequestT]):
|
|||
total: Optional total value e.g. 100
|
||||
message: Optional message e.g. Starting render...
|
||||
"""
|
||||
progress_token = self.request_context.meta.progressToken if self.request_context.meta else None
|
||||
progress_token = self.request_context.meta.progress_token if self.request_context.meta else None
|
||||
|
||||
if progress_token is None: # pragma: no cover
|
||||
return
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class FuncMetadata(BaseModel):
|
|||
if isinstance(result, CallToolResult):
|
||||
if self.output_schema is not None:
|
||||
assert self.output_model is not None, "Output model must be set if output schema is defined"
|
||||
self.output_model.model_validate(result.structuredContent)
|
||||
self.output_model.model_validate(result.structured_content)
|
||||
return result
|
||||
|
||||
unstructured_content = _convert_to_content(result)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class Image:
|
|||
else: # pragma: no cover
|
||||
raise ValueError("No image data available")
|
||||
|
||||
return ImageContent(type="image", data=data, mimeType=self._mime_type)
|
||||
return ImageContent(type="image", data=data, mime_type=self._mime_type)
|
||||
|
||||
|
||||
class Audio:
|
||||
|
|
@ -98,4 +98,4 @@ class Audio:
|
|||
else: # pragma: no cover
|
||||
raise ValueError("No audio data available")
|
||||
|
||||
return AudioContent(type="audio", data=data, mimeType=self._mime_type)
|
||||
return AudioContent(type="audio", data=data, mime_type=self._mime_type)
|
||||
|
|
|
|||
Loading…
Reference in a new issue