Refactor subagent and workflow domain models; migrate access tiers and events to domain module
- Moved `AccessTier` and `SubagentEvent` enums to `zesdex_domain::subagent`. - Consolidated workflow-related types into `zesdex_domain::workflow`. - Updated references across the codebase to use the new domain models. - Refactored tool execution logic to utilize a new `ToolExecutor` trait. - Enhanced `AgentTurnService` to handle tool calls and events more effectively. - Adjusted API handlers and state management to align with new domain structure.
This commit is contained in:
@@ -35,12 +35,14 @@ impl SubagentProvider {
|
||||
///
|
||||
/// Use this for a plain text-in/text-out conversation.
|
||||
#[tracing::instrument(skip(self, messages))]
|
||||
pub fn chat(
|
||||
pub async fn chat(
|
||||
&self,
|
||||
messages: &[ChatMessage],
|
||||
) -> Result<(ChatMessage, Option<(u64, u64)>)> {
|
||||
use zesdex_application::ports::ProviderService;
|
||||
self.client
|
||||
.chat_with_tools_non_streaming(messages, None, Some(4096), None, None)
|
||||
.chat(messages, None, Some(4096), None)
|
||||
.await
|
||||
}
|
||||
|
||||
/// Send messages with available tool definitions.
|
||||
@@ -48,14 +50,16 @@ impl SubagentProvider {
|
||||
/// Automatically converts the `&[Box<dyn Tool>]` slice to
|
||||
/// `Vec<ToolDef>` before passing to the underlying client.
|
||||
#[tracing::instrument(skip(self, messages, tools))]
|
||||
pub fn chat_with_tools(
|
||||
pub async fn chat_with_tools(
|
||||
&self,
|
||||
messages: &[ChatMessage],
|
||||
tools: &[Box<dyn Tool>],
|
||||
) -> Result<(ChatMessage, Option<(u64, u64)>)> {
|
||||
let defs = tool_defs(tools);
|
||||
use zesdex_application::ports::ProviderService;
|
||||
self.client
|
||||
.chat_with_tools_non_streaming(messages, Some(defs), Some(4096), None, None)
|
||||
.chat(messages, Some(defs), Some(4096), None)
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user