pub struct LlmConversationBuilder { /* private fields */ }Expand description
Builder for multi-turn LLM conversation mocks with scenario advancement
(mirrors org.mockserver.client.LlmConversationBuilder).
Implementations§
Source§impl LlmConversationBuilder
impl LlmConversationBuilder
Sourcepub fn with_provider(self, provider: impl Into<String>) -> Self
pub fn with_provider(self, provider: impl Into<String>) -> Self
Set the LLM provider (use a Provider constant).
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set the model name.
Sourcepub fn isolate_by(self, source: IsolationSource) -> Self
pub fn isolate_by(self, source: IsolationSource) -> Self
Isolate per-session conversations by the given source.
Sourcepub fn turn(self, turn: TurnBuilder) -> Self
pub fn turn(self, turn: TurnBuilder) -> Self
Add a turn to the conversation. Build the turn fluently and pass it back.
Sourcepub fn build(&self) -> Vec<Value>
pub fn build(&self) -> Vec<Value>
Build the list of conversation expectations.
The auto-generated scenario id makes the output non-deterministic between calls; tests should assert structure, not the exact uuid.
Sourcepub fn build_with_id(&self, conversation_uuid: &str) -> Vec<Value>
pub fn build_with_id(&self, conversation_uuid: &str) -> Vec<Value>
Build with an explicit conversation id (used by tests for determinism).
Sourcepub fn apply_to(&self, client: &MockServerClient) -> Result<Value>
pub fn apply_to(&self, client: &MockServerClient) -> Result<Value>
Build and register the expectations on the given client.
Trait Implementations§
Source§impl Clone for LlmConversationBuilder
impl Clone for LlmConversationBuilder
Source§fn clone(&self) -> LlmConversationBuilder
fn clone(&self) -> LlmConversationBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LlmConversationBuilder
impl Debug for LlmConversationBuilder
Source§impl Default for LlmConversationBuilder
impl Default for LlmConversationBuilder
Source§fn default() -> LlmConversationBuilder
fn default() -> LlmConversationBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LlmConversationBuilder
impl RefUnwindSafe for LlmConversationBuilder
impl Send for LlmConversationBuilder
impl Sync for LlmConversationBuilder
impl Unpin for LlmConversationBuilder
impl UnsafeUnpin for LlmConversationBuilder
impl UnwindSafe for LlmConversationBuilder
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