pub struct GeminiConfigs {Show 13 fields
pub prompt: Prompt,
pub model: String,
pub max_tokens: u16,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<i32>,
pub prompt_url_map: Option<Box<HashMap<CaseInsensitiveString, Box<Self>>>>,
pub extra_ai_data: bool,
pub paths_map: bool,
pub screenshot: bool,
pub api_key: Option<String>,
pub cache: Option<GeminiCache>,
pub json_schema: Option<ResponseFormatJsonSchema>,
}Expand description
The Gemini configs to use for dynamic Javascript execution and other functionality.
Fields§
§prompt: PromptThe prompt to use for the Chat. Example: Search for movies. This will attempt to get the code required to perform the action on the page.
model: StringThe model to use. Example: gemini-flash-latest, gemini-2.0-flash, gemini-1.5-pro
max_tokens: u16The max tokens to use for the request (max_output_tokens in Gemini).
temperature: Option<f32>The temperature between 0 - 2.
top_p: Option<f32>The top_p for the request.
top_k: Option<i32>The top_k for the request (Gemini-specific).
prompt_url_map: Option<Box<HashMap<CaseInsensitiveString, Box<Self>>>>Prompts to use for certain urls. If this is set only the urls that match exactly are ran.
extra_ai_data: boolExtra data, this will merge the prompts and try to get the content for you. Example: extracting data from the page.
paths_map: boolMap to paths. If the prompt_url_map has a key called /blog and all blog pages are found like /blog/something the same prompt is performed unless an exact match is found.
screenshot: boolTake a screenshot of the page after each JS script execution. The screenshot is stored as a base64.
api_key: Option<String>The API key to use for the request.
cache: Option<GeminiCache>Use caching to cache the prompt. This does nothing without the ‘cache_gemini’ flag enabled.
json_schema: Option<ResponseFormatJsonSchema>Use structured JSON mode.
Implementations§
Source§impl GeminiConfigs
impl GeminiConfigs
Sourcepub fn new(model: &str, prompt: &str, max_tokens: u16) -> GeminiConfigs
pub fn new(model: &str, prompt: &str, max_tokens: u16) -> GeminiConfigs
GeminiConfigs for Gemini chrome dynamic scripting.
Sourcepub fn new_default(prompt: &str, max_tokens: u16) -> GeminiConfigs
pub fn new_default(prompt: &str, max_tokens: u16) -> GeminiConfigs
GeminiConfigs with default model (gemini-flash-latest).
Sourcepub fn new_cache(
model: &str,
prompt: &str,
max_tokens: u16,
cache: Option<GeminiCache>,
) -> GeminiConfigs
pub fn new_cache( model: &str, prompt: &str, max_tokens: u16, cache: Option<GeminiCache>, ) -> GeminiConfigs
GeminiConfigs for Gemini chrome dynamic scripting and caching.
Sourcepub fn new_multi<I, S>(model: &str, prompt: I, max_tokens: u16) -> GeminiConfigs
pub fn new_multi<I, S>(model: &str, prompt: I, max_tokens: u16) -> GeminiConfigs
GeminiConfigs for Gemini chrome dynamic scripting multi chain prompts.
Sourcepub fn new_multi_cache<I, S>(
model: &str,
prompt: I,
max_tokens: u16,
cache: Option<GeminiCache>,
) -> GeminiConfigs
pub fn new_multi_cache<I, S>( model: &str, prompt: I, max_tokens: u16, cache: Option<GeminiCache>, ) -> GeminiConfigs
GeminiConfigs for Gemini chrome dynamic scripting multi chain prompts with prompt caching. The feature flag ‘cache_gemini’ is required.
Trait Implementations§
Source§impl Clone for GeminiConfigs
impl Clone for GeminiConfigs
Source§fn clone(&self) -> GeminiConfigs
fn clone(&self) -> GeminiConfigs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GeminiConfigs
impl Debug for GeminiConfigs
Source§impl Default for GeminiConfigs
impl Default for GeminiConfigs
Source§fn default() -> GeminiConfigs
fn default() -> GeminiConfigs
Source§impl PartialEq for GeminiConfigs
impl PartialEq for GeminiConfigs
impl StructuralPartialEq for GeminiConfigs
Auto Trait Implementations§
impl Freeze for GeminiConfigs
impl RefUnwindSafe for GeminiConfigs
impl Send for GeminiConfigs
impl Sync for GeminiConfigs
impl Unpin for GeminiConfigs
impl UnwindSafe for GeminiConfigs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more