Do not fetch pricing information if GOOSE_CLI_SHOW_COST is false (#3901)
Co-authored-by: Jack Wright <jack.wright@nike.com>
This commit is contained in:
@@ -1524,12 +1524,17 @@ impl Session {
|
|||||||
.get_param::<String>("GOOSE_PROVIDER")
|
.get_param::<String>("GOOSE_PROVIDER")
|
||||||
.unwrap_or_else(|_| "unknown".to_string());
|
.unwrap_or_else(|_| "unknown".to_string());
|
||||||
|
|
||||||
// Initialize pricing cache on startup
|
// Do not get costing information if show cost is disabled
|
||||||
tracing::info!("Initializing pricing cache...");
|
// This will prevent the API call to openrouter.ai
|
||||||
if let Err(e) = initialize_pricing_cache().await {
|
// This is useful if for cases where openrouter.ai may be blocked by corporate firewalls
|
||||||
tracing::warn!(
|
if show_cost {
|
||||||
"Failed to initialize pricing cache: {e}. Pricing data may not be available."
|
// Initialize pricing cache on startup
|
||||||
);
|
tracing::info!("Initializing pricing cache...");
|
||||||
|
if let Err(e) = initialize_pricing_cache().await {
|
||||||
|
tracing::warn!(
|
||||||
|
"Failed to initialize pricing cache: {e}. Pricing data may not be available."
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.get_metadata() {
|
match self.get_metadata() {
|
||||||
|
|||||||
Reference in New Issue
Block a user