feat: harden community production foundation through story 1.5
This commit is contained in:
1 parent
c30461cc92
commit
f6fc2e5c9b
161 files changed
+16758
-2515
No files matched your search
@@ -0,0 +1,23 @@
|
||||
use crank_registry::PublishedAgentTool;
|
||||
use crank_runtime::RuntimeOperation;
|
||||
|
||||
use super::ResolvedToolCall;
|
||||
|
||||
pub(crate) fn resolve_generated_tool(
|
||||
tools: &[PublishedAgentTool],
|
||||
tool_name: &str,
|
||||
) -> Option<ResolvedToolCall> {
|
||||
tools
|
||||
.iter()
|
||||
.find(|tool| tool.tool_name == tool_name)
|
||||
.cloned()
|
||||
.map(|tool| ResolvedToolCall { tool })
|
||||
}
|
||||
|
||||
pub(crate) fn runtime_operation(tool: &PublishedAgentTool) -> RuntimeOperation {
|
||||
let mut operation = RuntimeOperation::from(tool.operation.clone());
|
||||
operation.tool_name = tool.tool_name.clone();
|
||||
operation.tool_description.title = tool.tool_title.clone();
|
||||
operation.tool_description.description = tool.tool_description.clone();
|
||||
operation
|
||||
}
|
||||
Reference in new issue
Block a user