refactor: rename llm worker crate to engine

This commit is contained in:
2026-06-25 22:46:26 +09:00
parent 22598710fd
commit 292fc4ea5d
202 changed files with 1129 additions and 1125 deletions
@@ -0,0 +1,28 @@
use llm_engine::Engine;
use llm_engine::llm_client::capability::{
CacheStrategy, ModelCapability, StructuredOutput, ToolCallingSupport,
};
use llm_engine::llm_client::scheme::anthropic::AnthropicScheme;
use llm_engine::llm_client::transport::{HttpTransport, ResolvedAuth};
use std::sync::Arc;
fn main() {
let cap = ModelCapability {
tool_calling: ToolCallingSupport::Parallel,
structured_output: StructuredOutput::JsonSchema,
reasoning: None,
vision: false,
prompt_caching: CacheStrategy::Auto,
};
let client = HttpTransport::new(
AnthropicScheme::new(),
"dummy-model".to_string(),
"http://localhost:11434".to_string(),
ResolvedAuth::None,
cap,
);
let engine = Engine::new(client);
let mut locked = engine.lock();
let def: llm_engine::tool::ToolDefinition = Arc::new(|| panic!("unused"));
let _ = locked.register_tool(def);
}
@@ -0,0 +1,8 @@
error[E0599]: no method named `register_tool` found for struct `Engine<HttpTransport<AnthropicScheme>, Locked>` in the current scope
--> tests/ui/locked_register_tool.rs:27:20
|
27 | let _ = locked.register_tool(def);
| ^^^^^^^^^^^^^ method not found in `Engine<HttpTransport<AnthropicScheme>, Locked>`
|
= note: the method was found for
- `Engine<C>`
@@ -0,0 +1,28 @@
use llm_engine::Engine;
use llm_engine::llm_client::capability::{
CacheStrategy, ModelCapability, StructuredOutput, ToolCallingSupport,
};
use llm_engine::llm_client::scheme::anthropic::AnthropicScheme;
use llm_engine::llm_client::transport::{HttpTransport, ResolvedAuth};
use std::sync::Arc;
fn main() {
let cap = ModelCapability {
tool_calling: ToolCallingSupport::Parallel,
structured_output: StructuredOutput::JsonSchema,
reasoning: None,
vision: false,
prompt_caching: CacheStrategy::Auto,
};
let client = HttpTransport::new(
AnthropicScheme::new(),
"dummy-model".to_string(),
"http://localhost:11434".to_string(),
ResolvedAuth::None,
cap,
);
let engine = Engine::new(client);
let handle = engine.tool_server_handle();
let def: llm_engine::tool::ToolDefinition = Arc::new(|| panic!("unused"));
let _ = handle.register_tool(def);
}
@@ -0,0 +1,10 @@
error[E0624]: method `register_tool` is private
--> tests/ui/tool_server_handle_register_tool.rs:27:20
|
27 | let _ = handle.register_tool(def);
| ^^^^^^^^^^^^^ private method
|
::: src/tool_server.rs
|
| pub(crate) fn register_tool(&self, factory: EngineToolDefinition) {
| ----------------------------------------------------------------- private method defined here