pub enum ImageDetail {
Low,
High,
Auto,
}Expand description
Image detail level for vision API calls.
Controls the resolution and token cost of image processing.
§Token Costs Vary by Model ⚠️
OpenAI Vision API (reference values):
Low: ~85 tokens (512x512 max resolution)High: Variable tokens based on image dimensionsAuto: Model decides (balanced default)
Local models (llama.cpp, Ollama, vLLM):
- May have completely different token calculations
- Some models don’t charge tokens for images at all
- The
ImageDetailsetting may be ignored entirely
Recommendation: Always benchmark your specific model to understand actual token consumption. Do not rely on OpenAI’s values for capacity planning with local models.
§Examples
use open_agent::ImageDetail;
let detail = ImageDetail::High;
assert_eq!(detail.to_string(), "high");Variants§
Low
Low resolution (512x512), fixed 85 tokens
High
High resolution, variable tokens based on dimensions
Auto
Automatic selection (default)
Trait Implementations§
Source§impl Clone for ImageDetail
impl Clone for ImageDetail
Source§fn clone(&self) -> ImageDetail
fn clone(&self) -> ImageDetail
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageDetail
impl Debug for ImageDetail
Source§impl Default for ImageDetail
impl Default for ImageDetail
Source§fn default() -> ImageDetail
fn default() -> ImageDetail
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ImageDetail
impl<'de> Deserialize<'de> for ImageDetail
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
Source§impl Display for ImageDetail
impl Display for ImageDetail
Source§impl PartialEq for ImageDetail
impl PartialEq for ImageDetail
Source§impl Serialize for ImageDetail
impl Serialize for ImageDetail
impl Copy for ImageDetail
impl Eq for ImageDetail
impl StructuralPartialEq for ImageDetail
Auto Trait Implementations§
impl Freeze for ImageDetail
impl RefUnwindSafe for ImageDetail
impl Send for ImageDetail
impl Sync for ImageDetail
impl Unpin for ImageDetail
impl UnwindSafe for ImageDetail
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.