Support multiple OpenAI compatible providers (#34212)
TODO - [x] OpenAI Compatible API Icon - [x] Docs - [x] Link to docs in OpenAI provider section about configuring OpenAI API compatible providers Closes #33992 Related to #30010 Release Notes: - agent: Add support for adding multiple OpenAI API compatible providers --------- Co-authored-by: MrSubidubi <dev@bahn.sh> Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This commit is contained in:
parent
1a76a6b0bf
commit
230061a6cb
23 changed files with 1450 additions and 191 deletions
|
@ -93,6 +93,7 @@ impl RenderOnce for Modal {
|
|||
#[derive(IntoElement)]
|
||||
pub struct ModalHeader {
|
||||
headline: Option<SharedString>,
|
||||
description: Option<SharedString>,
|
||||
children: SmallVec<[AnyElement; 2]>,
|
||||
show_dismiss_button: bool,
|
||||
show_back_button: bool,
|
||||
|
@ -108,6 +109,7 @@ impl ModalHeader {
|
|||
pub fn new() -> Self {
|
||||
Self {
|
||||
headline: None,
|
||||
description: None,
|
||||
children: SmallVec::new(),
|
||||
show_dismiss_button: false,
|
||||
show_back_button: false,
|
||||
|
@ -123,6 +125,11 @@ impl ModalHeader {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn description(mut self, description: impl Into<SharedString>) -> Self {
|
||||
self.description = Some(description.into());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn show_dismiss_button(mut self, show: bool) -> Self {
|
||||
self.show_dismiss_button = show;
|
||||
self
|
||||
|
@ -171,7 +178,14 @@ impl RenderOnce for ModalHeader {
|
|||
}),
|
||||
)
|
||||
})
|
||||
.child(div().flex_1().children(children))
|
||||
.child(
|
||||
v_flex().flex_1().children(children).when_some(
|
||||
self.description,
|
||||
|this, description| {
|
||||
this.child(Label::new(description).color(Color::Muted).mb_2())
|
||||
},
|
||||
),
|
||||
)
|
||||
.when(self.show_dismiss_button, |this| {
|
||||
this.child(
|
||||
IconButton::new("dismiss", IconName::Close)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue