assistant2: Add testing environment variables (#27789)
To make it easier to design UIs for some of these scenarios. This PR adds specifically two variables: - `ZED_SIMULATE_NO_THREAD_HISTORY` - `ZED_SIMULATE_NO_LLM_PROVIDER` Release Notes: - N/A --------- Co-authored-by: Agus Zubiaga <hi@aguz.me>
This commit is contained in:
parent
0729d24d77
commit
d50905e000
@ -43,6 +43,11 @@ impl HistoryStore {
|
||||
pub fn entries(&self, cx: &mut Context<Self>) -> Vec<HistoryEntry> {
|
||||
let mut history_entries = Vec::new();
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
if std::env::var("ZED_SIMULATE_NO_THREAD_HISTORY").is_ok() {
|
||||
return history_entries;
|
||||
}
|
||||
|
||||
for thread in self.thread_store.update(cx, |this, _cx| this.threads()) {
|
||||
history_entries.push(HistoryEntry::Thread(thread));
|
||||
}
|
||||
|
@ -203,6 +203,11 @@ impl LanguageModelRegistry {
|
||||
}
|
||||
|
||||
pub fn active_provider(&self) -> Option<Arc<dyn LanguageModelProvider>> {
|
||||
#[cfg(debug_assertions)]
|
||||
if std::env::var("ZED_SIMULATE_NO_LLM_PROVIDER").is_ok() {
|
||||
return None;
|
||||
}
|
||||
|
||||
Some(self.active_model.as_ref()?.provider.clone())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user