refactor: remove crate re-export aliases from lib.rs (#18737)
This commit is contained in:
@@ -880,7 +880,7 @@ mod responses_endpoint_tests {
|
||||
let app = ctx.create_app().await;
|
||||
|
||||
// Directly store a response in the storage to test the retrieval endpoint
|
||||
use smg::data_connector::{ResponseId, StoredResponse};
|
||||
use data_connector::{ResponseId, StoredResponse};
|
||||
let mut stored_response = StoredResponse::new(None);
|
||||
stored_response.id = ResponseId::from("resp_test_input_items");
|
||||
stored_response.input = json!([
|
||||
|
||||
@@ -18,6 +18,9 @@ use std::{
|
||||
sync::{Arc, Mutex, OnceLock},
|
||||
};
|
||||
|
||||
use data_connector::{
|
||||
MemoryConversationItemStorage, MemoryConversationStorage, MemoryResponseStorage,
|
||||
};
|
||||
use mock_worker::{MockWorker, MockWorkerConfig};
|
||||
use serde_json::json;
|
||||
use smg::{
|
||||
@@ -27,9 +30,6 @@ use smg::{
|
||||
BasicWorkerBuilder, Job, LoadMonitor, ModelCard, RuntimeType, Worker, WorkerRegistry,
|
||||
WorkerType,
|
||||
},
|
||||
data_connector::{
|
||||
MemoryConversationItemStorage, MemoryConversationStorage, MemoryResponseStorage,
|
||||
},
|
||||
middleware::TokenBucket,
|
||||
policies::PolicyRegistry,
|
||||
protocols::common::{Function, Tool},
|
||||
@@ -386,7 +386,7 @@ pub async fn create_test_context(config: RouterConfig) -> Arc<AppContext> {
|
||||
}
|
||||
|
||||
// Initialize MCP manager with empty config
|
||||
use smg::mcp::{McpConfig, McpManager};
|
||||
use smg_mcp::{McpConfig, McpManager};
|
||||
let empty_config = McpConfig {
|
||||
servers: vec![],
|
||||
pool: Default::default(),
|
||||
@@ -510,7 +510,7 @@ pub async fn create_test_context_with_parsers(config: RouterConfig) -> Arc<AppCo
|
||||
}
|
||||
|
||||
// Initialize MCP manager with empty config
|
||||
use smg::mcp::{McpConfig, McpManager};
|
||||
use smg_mcp::{McpConfig, McpManager};
|
||||
let empty_config = McpConfig {
|
||||
servers: vec![],
|
||||
pool: Default::default(),
|
||||
@@ -535,7 +535,7 @@ pub async fn create_test_context_with_mcp_config(
|
||||
config: RouterConfig,
|
||||
mcp_config_path: &str,
|
||||
) -> Arc<AppContext> {
|
||||
use smg::mcp::{McpConfig, McpManager};
|
||||
use smg_mcp::{McpConfig, McpManager};
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
use std::sync::{Arc, OnceLock};
|
||||
|
||||
use axum::Router;
|
||||
use data_connector::{
|
||||
MemoryConversationItemStorage, MemoryConversationStorage, MemoryResponseStorage,
|
||||
};
|
||||
use reqwest::Client;
|
||||
use smg::{
|
||||
app_context::AppContext,
|
||||
@@ -8,16 +11,13 @@ use smg::{
|
||||
core::{
|
||||
BasicWorkerBuilder, LoadMonitor, ModelCard, RuntimeType, Worker, WorkerRegistry, WorkerType,
|
||||
},
|
||||
data_connector::{
|
||||
MemoryConversationItemStorage, MemoryConversationStorage, MemoryResponseStorage,
|
||||
},
|
||||
mcp::{McpConfig, McpManager},
|
||||
middleware::{AuthConfig, TokenBucket},
|
||||
policies::PolicyRegistry,
|
||||
routers::RouterTrait,
|
||||
server::{build_app, AppState},
|
||||
tokenizer::registry::TokenizerRegistry,
|
||||
};
|
||||
use smg_mcp::{McpConfig, McpManager};
|
||||
|
||||
/// Create a test Axum application using the actual server's build_app function
|
||||
#[allow(dead_code)]
|
||||
|
||||
@@ -13,7 +13,7 @@ use std::collections::HashMap;
|
||||
|
||||
use common::mock_mcp_server::MockMCPServer;
|
||||
use serde_json::json;
|
||||
use smg::mcp::{error::McpError, McpConfig, McpManager, McpServerConfig, McpTransport};
|
||||
use smg_mcp::{error::McpError, McpConfig, McpManager, McpServerConfig, McpTransport};
|
||||
|
||||
/// Create a new mock server for testing (each test gets its own)
|
||||
async fn create_mock_server() -> MockMCPServer {
|
||||
|
||||
@@ -16,10 +16,10 @@ use axum::{
|
||||
routing::post,
|
||||
Json, Router,
|
||||
};
|
||||
use data_connector::{ResponseId, StoredResponse};
|
||||
use serde_json::json;
|
||||
use smg::{
|
||||
config::{ConfigError, HistoryBackend, OracleConfig, RouterConfig, RoutingMode},
|
||||
data_connector::{ResponseId, StoredResponse},
|
||||
protocols::{
|
||||
chat::{ChatCompletionRequest, ChatMessage, MessageContent},
|
||||
common::StringOrArray,
|
||||
|
||||
@@ -215,12 +215,11 @@ mod pd_routing_unit_tests {
|
||||
let app_context = {
|
||||
use std::sync::{Arc, OnceLock};
|
||||
|
||||
use data_connector::{
|
||||
MemoryConversationItemStorage, MemoryConversationStorage, MemoryResponseStorage,
|
||||
};
|
||||
use smg::{
|
||||
core::{LoadMonitor, WorkerRegistry},
|
||||
data_connector::{
|
||||
MemoryConversationItemStorage, MemoryConversationStorage,
|
||||
MemoryResponseStorage,
|
||||
},
|
||||
middleware::TokenBucket,
|
||||
policies::PolicyRegistry,
|
||||
};
|
||||
|
||||
@@ -15,13 +15,13 @@ use axum::{
|
||||
extract::Request,
|
||||
http::{header::CONTENT_TYPE, StatusCode},
|
||||
};
|
||||
use data_connector::{
|
||||
MemoryConversationItemStorage, MemoryConversationStorage, MemoryResponseStorage,
|
||||
};
|
||||
use smg::{
|
||||
app_context::AppContext,
|
||||
config::RouterConfig,
|
||||
core::{LoadMonitor, WorkerRegistry},
|
||||
data_connector::{
|
||||
MemoryConversationItemStorage, MemoryConversationStorage, MemoryResponseStorage,
|
||||
},
|
||||
policies::PolicyRegistry,
|
||||
routers::RouterFactory,
|
||||
server::{build_app, AppState},
|
||||
@@ -113,7 +113,7 @@ async fn create_test_context_with_wasm() -> Arc<AppContext> {
|
||||
.expect("WorkflowEngines should only be initialized once");
|
||||
|
||||
// Initialize MCP manager with empty config
|
||||
use smg::mcp::{McpConfig, McpManager};
|
||||
use smg_mcp::{McpConfig, McpManager};
|
||||
let empty_config = McpConfig {
|
||||
servers: vec![],
|
||||
pool: Default::default(),
|
||||
@@ -668,10 +668,8 @@ async fn test_wasm_module_execution() {
|
||||
.expect("Workflow engines should be initialized");
|
||||
|
||||
// Create workflow context for registration
|
||||
use smg::{
|
||||
core::steps::{WasmModuleConfigRequest, WasmRegistrationWorkflowData},
|
||||
workflow::WorkflowId,
|
||||
};
|
||||
use smg::core::steps::{WasmModuleConfigRequest, WasmRegistrationWorkflowData};
|
||||
use wfaas::WorkflowId;
|
||||
|
||||
let descriptor = WasmModuleDescriptor {
|
||||
name: "test_execution_module".to_string(),
|
||||
@@ -716,7 +714,7 @@ async fn test_wasm_module_execution() {
|
||||
.expect("Failed to get workflow status");
|
||||
|
||||
match state.status {
|
||||
smg::workflow::WorkflowStatus::Completed => {
|
||||
wfaas::WorkflowStatus::Completed => {
|
||||
// Extract module UUID from typed workflow data
|
||||
break state
|
||||
.context
|
||||
@@ -724,7 +722,7 @@ async fn test_wasm_module_execution() {
|
||||
.module_uuid
|
||||
.expect("Module UUID should be in context");
|
||||
}
|
||||
smg::workflow::WorkflowStatus::Failed => {
|
||||
wfaas::WorkflowStatus::Failed => {
|
||||
panic!("Workflow failed: {:?}", state);
|
||||
}
|
||||
_ => {
|
||||
|
||||
Reference in New Issue
Block a user