pub struct ResolvedContext {
pub global: GlobalContext,
pub visible_workers: Vec<WorkerContext>,
pub escalations: Vec<(WorkerId, Escalation)>,
pub candidates: Vec<ActionCandidate>,
pub metadata: HashMap<String, Value>,
pub target: ContextTarget,
pub self_last_output: Option<String>,
pub manager_instruction: Option<ManagerInstruction>,
}Expand description
解決済みコンテキスト(LLM層に渡る)
ContextResolver が ContextStore + ContextView から生成。 プロンプト生成に必要な情報のみを含む。
Fields§
§global: GlobalContextGlobal情報
visible_workers: Vec<WorkerContext>可視範囲の Worker 情報
escalations: Vec<(WorkerId, Escalation)>可視範囲の Escalation
candidates: Vec<ActionCandidate>利用可能な Action 候補(プロンプト構築用)
metadata: HashMap<String, Value>追加メタデータ
target: ContextTargetこのコンテキストの対象
self_last_output: Option<String>自分の last_output(Scope::Minimal 用)
WorkerScope::Minimal の場合、visible_workers は空にし、 代わりにこのフィールドに自分の前回結果のみを格納する。
manager_instruction: Option<ManagerInstruction>Manager からの指示(前回 Guidance から抽出)
前回の Manager 判断を次回の Worker Prompt に埋め込むために使用。 Manager.prepare() で前回の Guidance から生成して設定する。
Implementations§
Source§impl ResolvedContext
impl ResolvedContext
Sourcepub fn new(global: GlobalContext, target: ContextTarget) -> Self
pub fn new(global: GlobalContext, target: ContextTarget) -> Self
新しい ResolvedContext を作成
Sourcepub fn with_workers(self, workers: Vec<WorkerContext>) -> Self
pub fn with_workers(self, workers: Vec<WorkerContext>) -> Self
Worker情報を追加
Sourcepub fn with_escalations(self, escalations: Vec<(WorkerId, Escalation)>) -> Self
pub fn with_escalations(self, escalations: Vec<(WorkerId, Escalation)>) -> Self
Escalationを追加
Sourcepub fn with_candidates(self, candidates: Vec<ActionCandidate>) -> Self
pub fn with_candidates(self, candidates: Vec<ActionCandidate>) -> Self
候補を設定
Sourcepub fn with_actions_config(self, config: &ActionsConfig) -> Self
pub fn with_actions_config(self, config: &ActionsConfig) -> Self
ActionsConfig から候補を設定
Sourcepub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
pub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
メタデータを追加
Sourcepub fn with_self_last_output(self, output: Option<String>) -> Self
pub fn with_self_last_output(self, output: Option<String>) -> Self
自分の last_output を設定(Scope::Minimal 用)
Sourcepub fn with_manager_instruction(self, instruction: ManagerInstruction) -> Self
pub fn with_manager_instruction(self, instruction: ManagerInstruction) -> Self
Manager からの指示を設定
Sourcepub fn has_escalations(&self) -> bool
pub fn has_escalations(&self) -> bool
Escalation があるか
Sourcepub fn is_manager(&self) -> bool
pub fn is_manager(&self) -> bool
対象がManagerか
Trait Implementations§
Source§impl Clone for ResolvedContext
impl Clone for ResolvedContext
Source§fn clone(&self) -> ResolvedContext
fn clone(&self) -> ResolvedContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResolvedContext
impl RefUnwindSafe for ResolvedContext
impl Send for ResolvedContext
impl Sync for ResolvedContext
impl Unpin for ResolvedContext
impl UnwindSafe for ResolvedContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more