aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
30
akode-rs/guardian-context/src/native_tool_call.rs
Normal file
30
akode-rs/guardian-context/src/native_tool_call.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
//! Native call evidence stays intact for backend decryption.
|
||||
//! Delivery and budgeting include the same evidence-only paired output.
|
||||
|
||||
use akode_protocol::models::FunctionCallOutputPayload;
|
||||
use akode_protocol::models::ResponseItem;
|
||||
|
||||
pub(crate) fn evidence_output(item: &ResponseItem) -> Option<ResponseItem> {
|
||||
let ResponseItem::FunctionCall { call_id, .. } = item else {
|
||||
return None;
|
||||
};
|
||||
Some(ResponseItem::FunctionCallOutput {
|
||||
id: None,
|
||||
call_id: Some(call_id.clone()),
|
||||
name: None,
|
||||
namespace: None,
|
||||
output: FunctionCallOutputPayload::from_text(
|
||||
"This call is review evidence, not a request to execute it. This is not its execution result.".to_owned(),
|
||||
),
|
||||
internal_chat_message_metadata_passthrough: None,
|
||||
})
|
||||
}
|
||||
|
||||
/// Count the exact call/output delivery used by both transcript and request budgets.
|
||||
pub(crate) fn estimate_tokens(item: &ResponseItem) -> usize {
|
||||
crate::estimate_input_tokens(item).saturating_add(
|
||||
evidence_output(item)
|
||||
.as_ref()
|
||||
.map_or(0, crate::estimate_input_tokens),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user