rename claudeapi to claudeagent
This commit is contained in:
@@ -83,14 +83,14 @@ pub enum ClaudeError {
|
|||||||
///
|
///
|
||||||
/// Requests are processed serially by a background worker to prevent
|
/// Requests are processed serially by a background worker to prevent
|
||||||
/// concurrent API calls.
|
/// concurrent API calls.
|
||||||
pub struct ClaudeApi {
|
pub struct ClaudeAgent {
|
||||||
input_tx: mpsc::Sender<Input>,
|
input_tx: mpsc::Sender<Input>,
|
||||||
stop_tx: mpsc::Sender<()>,
|
stop_tx: mpsc::Sender<()>,
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
worker_handle: tokio::task::JoinHandle<()>,
|
worker_handle: tokio::task::JoinHandle<()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ClaudeApi {
|
impl ClaudeAgent {
|
||||||
/// Create a new Claude API client from configuration.
|
/// Create a new Claude API client from configuration.
|
||||||
///
|
///
|
||||||
/// Reads the API key and system prompt from the configured files.
|
/// Reads the API key and system prompt from the configured files.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
use crate::signal_jsonrpc::connect_ipc;
|
use crate::signal_jsonrpc::connect_ipc;
|
||||||
use crate::{
|
use crate::{
|
||||||
alertmanager::AlertPost,
|
alertmanager::AlertPost,
|
||||||
claude::{ClaudeApi, ClaudeConfig, SentBy, Tool, ToolExecutor, ToolResult},
|
claude::{ClaudeAgent, ClaudeConfig, SentBy, Tool, ToolExecutor, ToolResult},
|
||||||
log_message::{LogMessage, Origin},
|
log_message::{LogMessage, Origin},
|
||||||
message_handler::{AdminMessage, AdminMessageResponse, Context, MessageHandlerResult},
|
message_handler::{AdminMessage, AdminMessageResponse, Context, MessageHandlerResult},
|
||||||
prometheus::{Prometheus, PrometheusConfig},
|
prometheus::{Prometheus, PrometheusConfig},
|
||||||
@@ -251,7 +251,7 @@ pub struct Gateway {
|
|||||||
command_router: CommandRouter,
|
command_router: CommandRouter,
|
||||||
/// Claude API client for AI-powered responses.
|
/// Claude API client for AI-powered responses.
|
||||||
/// Initialized after Arc creation so it can hold a weak reference back to Gateway.
|
/// Initialized after Arc creation so it can hold a weak reference back to Gateway.
|
||||||
claude: OnceLock<Box<ClaudeApi>>,
|
claude: OnceLock<Box<ClaudeAgent>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Gateway {
|
impl Gateway {
|
||||||
@@ -287,7 +287,7 @@ impl Gateway {
|
|||||||
|
|
||||||
// Initialize Claude with a weak reference back to the gateway
|
// Initialize Claude with a weak reference back to the gateway
|
||||||
if let Some(cc) = claude_config {
|
if let Some(cc) = claude_config {
|
||||||
let claude = ClaudeApi::new(cc, Arc::downgrade(&gateway) as Weak<dyn ToolExecutor>)
|
let claude = ClaudeAgent::new(cc, Arc::downgrade(&gateway) as Weak<dyn ToolExecutor>)
|
||||||
.expect("Invalid claude config");
|
.expect("Invalid claude config");
|
||||||
gateway
|
gateway
|
||||||
.claude
|
.claude
|
||||||
|
|||||||
Reference in New Issue
Block a user