pub struct Resource {
pub annotations: Option<ResourceAnnotations>,
pub description: Option<String>,
pub mime_type: Option<String>,
pub name: String,
pub size: Option<i64>,
pub uri: String,
}
Expand description
A known resource that the server is capable of reading.
JSON schema
{
"description": "A known resource that the server is capable of reading.",
"type": "object",
"required": [
"name",
"uri"
],
"properties": {
"annotations": {
"type": "object",
"properties": {
"audience": {
"description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., [\"user\", \"assistant\"]).",
"type": "array",
"items": {
"$ref": "#/definitions/Role"
}
},
"priority": {
"description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
"type": "number",
"maximum": 1.0,
"minimum": 0.0
}
}
},
"description": {
"description": "A description of what this resource represents.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.",
"type": "string"
},
"mimeType": {
"description": "The MIME type of this resource, if known.",
"type": "string"
},
"name": {
"description": "A human-readable name for this resource.\n\nThis can be used by clients to populate UI elements.",
"type": "string"
},
"size": {
"description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window usage.",
"type": "integer"
},
"uri": {
"description": "The URI of this resource.",
"type": "string",
"format": "uri"
}
}
}
Fields§
§annotations: Option<ResourceAnnotations>
§description: Option<String>
A description of what this resource represents. This can be used by clients to improve the LLM’s understanding of available resources. It can be thought of like a “hint” to the model.
mime_type: Option<String>
The MIME type of this resource, if known.
name: String
A human-readable name for this resource. This can be used by clients to populate UI elements.
size: Option<i64>
The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known. This can be used by Hosts to display file sizes and estimate context window usage.
uri: String
The URI of this resource.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Resource
impl<'de> Deserialize<'de> for Resource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more