merge poc-agent into poc-memory as agent/ module
Eliminates the circular dependency between poc-agent and poc-memory by moving all poc-agent source into poc-memory/src/agent/. The poc-agent binary now builds from poc-memory/src/bin/poc-agent.rs using library imports. All poc_agent:: references updated to crate::agent::. poc-agent/ directory kept for now (removed from workspace members). Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
01abd795ce
commit
891cca57f8
35 changed files with 9178 additions and 88 deletions
|
|
@ -7,10 +7,10 @@
|
|||
//
|
||||
// Activated when config has api_base_url set.
|
||||
|
||||
use poc_agent::api::ApiClient;
|
||||
use poc_agent::types::*;
|
||||
use poc_agent::tools::{self, ProcessTracker};
|
||||
use poc_agent::ui_channel::StreamTarget;
|
||||
use crate::agent::api::ApiClient;
|
||||
use crate::agent::types::*;
|
||||
use crate::agent::tools::{self, ProcessTracker};
|
||||
use crate::agent::ui_channel::StreamTarget;
|
||||
|
||||
use std::sync::OnceLock;
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ pub async fn call_api_with_tools(
|
|||
let client = get_client()?;
|
||||
|
||||
// Set up a UI channel — we drain reasoning tokens into the log
|
||||
let (ui_tx, mut ui_rx) = poc_agent::ui_channel::channel();
|
||||
let (ui_tx, mut ui_rx) = crate::agent::ui_channel::channel();
|
||||
|
||||
// Build tool definitions — memory tools for graph operations
|
||||
let all_defs = tools::definitions();
|
||||
|
|
@ -78,7 +78,7 @@ pub async fn call_api_with_tools(
|
|||
{
|
||||
let mut reasoning_buf = String::new();
|
||||
while let Ok(ui_msg) = ui_rx.try_recv() {
|
||||
if let poc_agent::ui_channel::UiMessage::Reasoning(r) = ui_msg {
|
||||
if let crate::agent::ui_channel::UiMessage::Reasoning(r) = ui_msg {
|
||||
reasoning_buf.push_str(&r);
|
||||
}
|
||||
}
|
||||
|
|
@ -127,14 +127,14 @@ pub async fn call_api_with_tools(
|
|||
|
||||
let output = if call.function.name.starts_with("memory_") {
|
||||
let prov = format!("agent:{}", agent);
|
||||
match poc_agent::tools::memory::dispatch(
|
||||
match crate::agent::tools::memory::dispatch(
|
||||
&call.function.name, &args, Some(&prov),
|
||||
) {
|
||||
Ok(text) => poc_agent::tools::ToolOutput {
|
||||
Ok(text) => crate::agent::tools::ToolOutput {
|
||||
text, is_yield: false, images: Vec::new(),
|
||||
model_switch: None, dmn_pause: false,
|
||||
},
|
||||
Err(e) => poc_agent::tools::ToolOutput {
|
||||
Err(e) => crate::agent::tools::ToolOutput {
|
||||
text: format!("Error: {}", e),
|
||||
is_yield: false, images: Vec::new(),
|
||||
model_switch: None, dmn_pause: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue