Rinomina: crate akode-*, cartelle akode-rs/ e akode-cli/, binario akode, ~/.akode, AKODE_* (A)
Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
24
akode-rs/core/src/function_tool.rs
Normal file
24
akode-rs/core/src/function_tool.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use std::future::Future;
|
||||
|
||||
use akode_async_utils::OrCancelExt;
|
||||
pub use akode_tools::FunctionCallError;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
/// Maps cancellation to the standard tool-call error while preserving the future's output.
|
||||
pub(crate) trait OrCancelToolExt: OrCancelExt + Send {
|
||||
fn or_cancel_tool(
|
||||
self,
|
||||
token: &CancellationToken,
|
||||
) -> impl Future<Output = Result<Self::Output, FunctionCallError>> + Send;
|
||||
}
|
||||
|
||||
impl<F: OrCancelExt + Send> OrCancelToolExt for F {
|
||||
async fn or_cancel_tool(
|
||||
self,
|
||||
token: &CancellationToken,
|
||||
) -> Result<Self::Output, FunctionCallError> {
|
||||
self.or_cancel(token)
|
||||
.await
|
||||
.map_err(|_| FunctionCallError::RespondToModel("tool call cancelled".to_string()))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user