Rename ResourceReference to ResourceTemplateReference (#947)
This commit is contained in:
parent
bac2705426
commit
f3cd20c920
1 changed files with 10 additions and 4 deletions
|
|
@ -3,6 +3,7 @@ from typing import Annotated, Any, Generic, Literal, TypeAlias, TypeVar
|
|||
|
||||
from pydantic import BaseModel, ConfigDict, Field, FileUrl, RootModel
|
||||
from pydantic.networks import AnyUrl, UrlConstraints
|
||||
from typing_extensions import deprecated
|
||||
|
||||
"""
|
||||
Model Context Protocol bindings for Python
|
||||
|
|
@ -961,7 +962,7 @@ class CreateMessageResult(Result):
|
|||
"""The reason why sampling stopped, if known."""
|
||||
|
||||
|
||||
class ResourceReference(BaseModel):
|
||||
class ResourceTemplateReference(BaseModel):
|
||||
"""A reference to a resource or resource template definition."""
|
||||
|
||||
type: Literal["ref/resource"]
|
||||
|
|
@ -970,6 +971,11 @@ class ResourceReference(BaseModel):
|
|||
model_config = ConfigDict(extra="allow")
|
||||
|
||||
|
||||
@deprecated("`ResourceReference` is deprecated, you should use `ResourceTemplateReference`.")
|
||||
class ResourceReference(ResourceTemplateReference):
|
||||
pass
|
||||
|
||||
|
||||
class PromptReference(BaseModel):
|
||||
"""Identifies a prompt."""
|
||||
|
||||
|
|
@ -992,7 +998,7 @@ class CompletionArgument(BaseModel):
|
|||
class CompleteRequestParams(RequestParams):
|
||||
"""Parameters for completion requests."""
|
||||
|
||||
ref: ResourceReference | PromptReference
|
||||
ref: ResourceTemplateReference | PromptReference
|
||||
argument: CompletionArgument
|
||||
model_config = ConfigDict(extra="allow")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue