pub struct Resource {
pub annotations: Option<Annotations>,
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": {
"description": "Optional annotations for the client.",
"$ref": "#/definitions/Annotations"
},
"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<Annotations>
Optional annotations for the client.
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