pub struct Mutable;Expand description
編集可能状態
この状態では以下の操作が可能です:
- システムプロンプトの設定・変更
- メッセージ履歴の編集(追加、削除、クリア)
- ツール・Hookの登録
Worker::lock()によりCacheLocked状態へ遷移できます。
§Examples
ⓘ
use llm_worker::Worker;
let mut worker = Worker::new(client)
.system_prompt("You are helpful.");
// 履歴を編集可能
worker.push_message(Message::user("Hello"));
worker.clear_history();
// ロックして保護状態へ
let locked = worker.lock();Trait Implementations§
impl Copy for Mutable
impl WorkerState for Mutable
Auto Trait Implementations§
impl Freeze for Mutable
impl RefUnwindSafe for Mutable
impl Send for Mutable
impl Sync for Mutable
impl Unpin for Mutable
impl UnwindSafe for Mutable
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