pub struct ThreadSafeRandAgentBuilder { /* private fields */ }Expand description
线程安全 RandAgent 的构建器
Implementations§
Source§impl ThreadSafeRandAgentBuilder
impl ThreadSafeRandAgentBuilder
Sourcepub fn max_failures(self, max_failures: u32) -> Self
pub fn max_failures(self, max_failures: u32) -> Self
设置连续失败的最大次数,超过后标记代理为无效
Sourcepub fn add_agent(
self,
agent: BoxAgent<'static>,
provider_name: String,
model_name: String,
) -> Self
pub fn add_agent( self, agent: BoxAgent<'static>, provider_name: String, model_name: String, ) -> Self
添加代理到构建器
§参数
- agent: 代理实例(需要是 ’static 生命周期)
- provider_name: 提供方名称(如 openai、bigmodel 等)
- model_name: 模型名称(如 gpt-3.5、glm-4-flash 等)
Sourcepub fn add_builder(
self,
builder: Agent<CompletionModelHandle<'static>>,
provider_name: &str,
model_name: &str,
) -> Self
pub fn add_builder( self, builder: Agent<CompletionModelHandle<'static>>, provider_name: &str, model_name: &str, ) -> Self
从 AgentBuilder 添加代理
§参数
- builder: AgentBuilder 实例(需要是 ’static 生命周期)
- provider_name: 提供方名称(如 openai、bigmodel 等)
- model_name: 模型名称(如 gpt-3.5、glm-4-flash 等)
Sourcepub fn build(self) -> ThreadSafeRandAgent
pub fn build(self) -> ThreadSafeRandAgent
构建 ThreadSafeRandAgent
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ThreadSafeRandAgentBuilder
impl !RefUnwindSafe for ThreadSafeRandAgentBuilder
impl Send for ThreadSafeRandAgentBuilder
impl Sync for ThreadSafeRandAgentBuilder
impl Unpin for ThreadSafeRandAgentBuilder
impl !UnwindSafe for ThreadSafeRandAgentBuilder
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