Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore: kill ai_format + replace prompt attachments with attachment crate (#2995)

Eric Hayes1ae843f901c2
diff --git a/rust/cloud-storage/Cargo.lock b/rust/cloud-storage/Cargo.lock
index d158d08e34..baffff7db7 100644
--- a/rust/cloud-storage/Cargo.lock
+++ b/rust/cloud-storage/Cargo.lock
@@ -45,7 +45,6 @@ dependencies = [
name = "ai"
version = "0.1.0"
dependencies = [
- "ai_format",
"ai_toolset",
"anthropic",
"anyhow",
@@ -72,20 +71,11 @@ dependencies = [
"utoipa",
]
-[[package]]
-name = "ai_format"
-version = "0.1.0"
-dependencies = [
- "chrono",
- "models_properties",
-]
-
[[package]]
name = "ai_tools"
version = "0.1.0"
dependencies = [
"ai",
- "ai_format",
"ai_toolset",
"anthropic",
"anyhow",
@@ -2155,7 +2145,6 @@ dependencies = [
name = "comms_service"
version = "0.1.0"
dependencies = [
- "ai_format",
"anyhow",
"async-trait",
"aws-sdk-secretsmanager",
@@ -3075,7 +3064,6 @@ version = "0.1.0"
dependencies = [
"aho-corasick",
"ai",
- "ai_format",
"ai_tools",
"ai_toolset",
"anyhow",
@@ -6737,7 +6725,6 @@ name = "model"
version = "0.1.0"
dependencies = [
"ai",
- "ai_format",
"anyhow",
"axum",
"base64 0.22.1",
diff --git a/rust/cloud-storage/Cargo.toml b/rust/cloud-storage/Cargo.toml
index d7bc2e5bb8..b466bd9cfc 100644
--- a/rust/cloud-storage/Cargo.toml
+++ b/rust/cloud-storage/Cargo.toml
@@ -2,8 +2,7 @@
resolver = "2"
members = [
- "ai",
- "ai_format",
+ "ai",
"ai_tools",
"ai_toolset",
"analytics_client",
diff --git a/rust/cloud-storage/ai/Cargo.toml b/rust/cloud-storage/ai/Cargo.toml
index 28fe832886..36bbf5e7ec 100644
--- a/rust/cloud-storage/ai/Cargo.toml
+++ b/rust/cloud-storage/ai/Cargo.toml
@@ -34,5 +34,4 @@ anthropic = { path = "../anthropic" }
ai_toolset = { path = "../ai_toolset" }
macro_user_id = { path = "../macro_user_id" }
model_file_type = { path = "../model_file_type"}
-ai_format = { path = "../ai_format" }
attachment = { path = "../attachment" }
diff --git a/rust/cloud-storage/ai/src/traits.rs b/rust/cloud-storage/ai/src/traits.rs
index 258a1b4ac4..03e11024b0 100644
--- a/rust/cloud-storage/ai/src/traits.rs
+++ b/rust/cloud-storage/ai/src/traits.rs
@@ -1,5 +1,3 @@
-pub use ai_format::traits::TextAttachment;
-
use serde::Deserialize;
pub trait Metadata: for<'de> Deserialize<'de> {
diff --git a/rust/cloud-storage/ai/src/types/message/mod.rs b/rust/cloud-storage/ai/src/types/message/mod.rs
index 9a86147076..6a53da0736 100644
--- a/rust/cloud-storage/ai/src/types/message/mod.rs
+++ b/rust/cloud-storage/ai/src/types/message/mod.rs
@@ -1,11 +1,9 @@
mod chat_message;
mod message_builder;
-mod prompt_attachments;
mod system_prompt;
pub use chat_message::*;
pub use message_builder::*;
-pub use prompt_attachments::*;
pub use system_prompt::SystemPrompt;
use serde::{Deserialize, Serialize};
diff --git a/rust/cloud-storage/ai/src/types/message/prompt_attachments.rs b/rust/cloud-storage/ai/src/types/message/prompt_attachments.rs
deleted file mode 100644
index 3add66860b..0000000000
--- a/rust/cloud-storage/ai/src/types/message/prompt_attachments.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-use crate::traits::TextAttachment;
-
-#[derive(Debug, Clone, Default)]
-pub struct PromptAttachments(Vec<String>);
-
-impl<T> From<Vec<T>> for PromptAttachments
-where
- T: TextAttachment + 'static,
-{
- fn from(value: Vec<T>) -> Self {
- Self(value.into_iter().map(|a| a.to_string()).collect())
- }
-}
-
-impl From<&[&dyn TextAttachment]> for PromptAttachments {
- fn from(value: &[&dyn TextAttachment]) -> Self {
- Self(value.iter().map(|a| a.to_string()).collect())
- }
-}
-
-impl std::ops::Deref for PromptAttachments {
- type Target = Vec<String>;
- fn deref(&self) -> &Self::Target {
- &self.0
- }
-}
diff --git a/rust/cloud-storage/ai/src/types/message/system_prompt.rs b/rust/cloud-storage/ai/src/types/message/system_prompt.rs
index 4fa6512242..94bac8ac52 100644
--- a/rust/cloud-storage/ai/src/types/message/system_prompt.rs
+++ b/rust/cloud-storage/ai/src/types/message/system_prompt.rs
@@ -1,17 +1,7 @@
-use super::prompt_attachments::PromptAttachments;
+use attachment::Attachments;
-#[derive(Debug, Clone)]
+#[derive(Debug)]
pub struct SystemPrompt {
pub instructions: String,
- pub attachments: PromptAttachments,
-}
-
-impl std::fmt::Display for SystemPrompt {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- writeln!(f, "{}", self.instructions)?;
- for attachment in self.attachments.iter() {
- writeln!(f, "{}", attachment)?;
- }
- Ok(())
- }
+ pub attachments: Option<Attachments<'static>>,
}
diff --git a/rust/cloud-storage/ai/src/types/providers/openai/request.rs b/rust/cloud-storage/ai/src/types/providers/openai/request.rs
index a06aa21e45..47c2425c35 100644
--- a/rust/cloud-storage/ai/src/types/providers/openai/request.rs
+++ b/rust/cloud-storage/ai/src/types/providers/openai/request.rs
@@ -14,7 +14,7 @@ impl ChatCompletionRequest {
let system_message =
ChatCompletionRequestMessage::System(ChatCompletionRequestSystemMessage {
content: ChatCompletionRequestSystemMessageContent::Text(
- self.system_prompt.to_string(),
+ self.system_prompt.instructions,
),
name: None,
});
diff --git a/rust/cloud-storage/ai/src/types/providers/openai/response.rs b/rust/cloud-storage/ai/src/types/providers/openai/response.rs
index 9d53b81d5e..f6bff0adba 100644
--- a/rust/cloud-storage/ai/src/types/providers/openai/response.rs
+++ b/rust/cloud-storage/ai/src/types/providers/openai/response.rs
@@ -18,7 +18,7 @@ impl TryFrom<ChatCompletionRequest> for CreateChatCompletionRequest {
let system_message =
ChatCompletionRequestMessage::System(ChatCompletionRequestSystemMessage {
content: ChatCompletionRequestSystemMessageContent::Text(
- value.system_prompt.to_string(),
+ value.system_prompt.instructions,
),
name: None,
});
diff --git a/rust/cloud-storage/ai/src/types/request_builder.rs b/rust/cloud-storage/ai/src/types/request_builder.rs
index d6c78c4b3d..e37eec4d9f 100644
--- a/rust/cloud-storage/ai/src/types/request_builder.rs
+++ b/rust/cloud-storage/ai/src/types/request_builder.rs
@@ -192,7 +192,7 @@ mod test {
// Verify system prompt (no attachments)
assert_eq!(request.system_prompt.instructions, "Basic system prompt");
- assert!(request.system_prompt.attachments.is_empty());
+ assert!(request.system_prompt.attachments.is_none());
// Verify model and default max_tokens
assert_eq!(request.model, Model::Claude35Sonnet);
diff --git a/rust/cloud-storage/ai_format/Cargo.toml b/rust/cloud-storage/ai_format/Cargo.toml
deleted file mode 100644
index 7676ca2081..0000000000
--- a/rust/cloud-storage/ai_format/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-edition = "2024"
-name = "ai_format"
-publish = false
-version = "0.1.0"
-
-[dependencies]
-chrono = { workspace = true }
-models_properties = { path = "../models_properties"}
diff --git a/rust/cloud-storage/ai_format/src/document.rs b/rust/cloud-storage/ai_format/src/document.rs
deleted file mode 100644
index 9cc0c058e8..0000000000
--- a/rust/cloud-storage/ai_format/src/document.rs
+++ /dev/null
@@ -1,55 +0,0 @@
-use super::util::Indent;
-use crate::properties::Properties;
-use crate::traits::TextAttachment;
-
-pub struct Document {
- pub content: String,
- pub file_type: String,
- pub id: String,
- pub name: String,
- pub properties: Option<Properties>,
-}
-
-impl std::fmt::Debug for Document {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- f.debug_struct("Document")
- .field(
- "content",
- &format!("content [{} chars]", self.content.len()),
- )
- .field("file_type", &self.file_type)
- .field("id", &self.id)
- .field("name", &self.name)
- .field("properties", &self.properties)
- .finish()
- }
-}
-
-impl std::fmt::Display for Document {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- writeln!(
- f,
- r#"<document id="{}" file_type="{}" name="{}">"#,
- self.id, self.file_type, self.name
- )?;
-
- // Include properties before content if present
- if let Some(props) = &self.properties
- && !props.is_empty()
- {
- writeln!(f, "{}", Indent(4, props))?;
- }
- writeln!(f, "{}", Indent(4, "<content>"))?;
- writeln!(f, "{}", Indent(8, &self.content))?;
- writeln!(f, "{}", Indent(4, "</content>"))?;
- write!(f, "</document>")
- }
-}
-
-impl TextAttachment for Document {}
-
-impl Document {
- pub fn boxed(self) -> Box<dyn TextAttachment> {
- Box::new(self)
- }
-}
diff --git a/rust/cloud-storage/ai_format/src/insight_context_log.rs b/rust/cloud-storage/ai_format/src/insight_context_log.rs
deleted file mode 100644
index 4cb8cf8d55..0000000000
--- a/rust/cloud-storage/ai_format/src/insight_context_log.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-use std::fmt::Display;
-
-pub struct InsightContextLog<T: Display> {
- pub name: String,
- pub metadata: Vec<(String, String)>,
- pub content: T,
-}
-
-impl<T> Display for InsightContextLog<T>
-where
- T: Display + Sized,
-{
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- let metadata = self
- .metadata
- .iter()
- .map(|(k, v)| format!("{}: {}", k, v))
- .collect::<Vec<_>>()
- .join(", ");
- writeln!(f, "[{}]", self.name)?;
- if !metadata.is_empty() {
- writeln!(f, "{}", metadata)?;
- }
- writeln!(f, "{}", self.content)?;
- writeln!(f, "[END {}]", self.name)
- }
-}
diff --git a/rust/cloud-storage/ai_format/src/lib.rs b/rust/cloud-storage/ai_format/src/lib.rs
deleted file mode 100644
index 2b8d73d3d5..0000000000
--- a/rust/cloud-storage/ai_format/src/lib.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-pub mod document;
-pub mod insight_context_log;
-pub mod properties;
-pub mod traits;
-pub mod util;
diff --git a/rust/cloud-storage/ai_format/src/properties.rs b/rust/cloud-storage/ai_format/src/properties.rs
deleted file mode 100644
index e17bfaa877..0000000000
--- a/rust/cloud-storage/ai_format/src/properties.rs
+++ /dev/null
@@ -1,141 +0,0 @@
-//! AI formatting for entity properties.
-//!
-//! Provides XML-like formatting for key-value properties to be included
-//! in AI document context.
-
-use crate::util::{Date, Indent};
-
-use models_properties::EntityType;
-use models_properties::service::entity_property_with_definition::EntityPropertyWithDefinition;
-use models_properties::service::property_value::PropertyValue;
-use std::fmt;
-
-/// A single property key-value pair.
-#[derive(Debug, Clone)]
-pub struct Property {
- pub(crate) key: String,
- pub(crate) value: String,
-}
-
-impl Property {
- pub fn from_property(property: EntityPropertyWithDefinition) -> Self {
- property
- .value
- .as_ref()
- .and_then(|v| format_property_value(v, &property.options))
- .map(|s| Self {
- key: property.definition.display_name.clone(),
- value: s,
- })
- .unwrap_or_else(|| Self {
- key: property.definition.display_name,
- value: "null".into(),
- })
- }
-}
-
-impl fmt::Display for Property {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(
- f,
- "<property key=\"{}\">{}</property>",
- self.key, self.value
- )
- }
-}
-
-/// A collection of properties for an entity.
-#[derive(Debug, Clone, Default)]
-pub struct Properties {
- pub(crate) kind: String,
- pub(crate) items: Vec<Property>,
-}
-
-impl Properties {
- pub fn from_properties(
- kind: EntityType,
- properties: Vec<EntityPropertyWithDefinition>,
- ) -> Self {
- Self {
- kind: kind.to_string(),
- items: properties
- .into_iter()
- .map(Property::from_property)
- .collect(),
- }
- }
-
- pub fn is_empty(&self) -> bool {
- self.items.is_empty()
- }
-}
-
-impl fmt::Display for Properties {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- if self.items.is_empty() {
- return Ok(());
- }
-
- writeln!(f, "<properties entity_kind=\"{}\">", self.kind)?;
- for prop in &self.items {
- writeln!(f, "{}", Indent(4, prop))?;
- }
- write!(f, "</properties>")
- }
-}
-
-/// Format a property value as a human-readable string.
-fn format_property_value(
- value: &PropertyValue,
- options: &Option<Vec<models_properties::service::property_option::PropertyOption>>,
-) -> Option<String> {
- match value {
- PropertyValue::Bool(b) => Some(if *b { "Yes" } else { "No" }.to_string()),
- PropertyValue::Num(n) => Some(n.to_string()),
- PropertyValue::Str(s) => Some(s.clone()),
- PropertyValue::Date(d) => Some(Date(d.to_owned()).to_string()),
- PropertyValue::SelectOption(ids) => {
- // Look up option display values
- let opts = options.as_ref()?;
- let values: Vec<String> = ids
- .iter()
- .filter_map(|id| {
- opts.iter().find(|o| &o.id == id).map(|o| {
- match &o.value {
- models_properties::service::property_option::PropertyOptionValue::String(
- s,
- ) => s.clone(),
- models_properties::service::property_option::PropertyOptionValue::Number(
- n,
- ) => n.to_string(),
- }
- })
- })
- .collect();
-
- if values.is_empty() {
- None
- } else {
- Some(values.join(", "))
- }
- }
- PropertyValue::EntityRef(refs) => {
- if refs.is_empty() {
- None
- } else {
- let ids: Vec<String> = refs
- .iter()
- .map(|r| format!("{}:{}", r.entity_type, r.entity_id))
- .collect();
- Some(ids.join(", "))
- }
- }
- PropertyValue::Link(urls) => {
- if urls.is_empty() {
- None
- } else {
- Some(urls.join(", "))
- }
- }
- }
-}
diff --git a/rust/cloud-storage/ai_format/src/traits.rs b/rust/cloud-storage/ai_format/src/traits.rs
deleted file mode 100644
index a932c00868..0000000000
--- a/rust/cloud-storage/ai_format/src/traits.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-pub trait TextAttachment: std::fmt::Display + std::fmt::Debug + Send + Sync {}
-
-impl TextAttachment for Box<dyn TextAttachment> {}
diff --git a/rust/cloud-storage/ai_format/src/util.rs b/rust/cloud-storage/ai_format/src/util.rs
deleted file mode 100644
index 2809e5bc57..0000000000
--- a/rust/cloud-storage/ai_format/src/util.rs
+++ /dev/null
@@ -1,132 +0,0 @@
-use chrono::{DateTime, Utc};
-use std::fmt::Display;
-
-pub fn truncate<T: Display>(v: T, limit: usize) -> String {
- let content = v.to_string();
- content
- .char_indices()
- .nth(limit)
- .map(|(i, _)| format!("{}...", &content[..i]))
- .unwrap_or(content)
-}
-
-pub struct Date(pub DateTime<Utc>);
-pub struct Indent<T: Sized>(pub usize, pub T);
-pub struct Truncate<T: Sized>(pub usize, pub T);
-
-impl Display for Date {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "{}", self.0.to_rfc2822())
- }
-}
-
-impl<T> Display for Indent<T>
-where
- T: Display + Sized,
-{
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- let text = self.1.to_string();
- let mut iter = text.lines().peekable();
- while let Some(line) = iter.next() {
- if iter.peek().is_some() {
- writeln!(f, "{:indent$}{}", "", line, indent = self.0)?;
- } else {
- write!(f, "{:indent$}{}", "", line, indent = self.0)?;
- }
- }
- Ok(())
- }
-}
-
-impl<T> Display for Truncate<T>
-where
- T: Display + Sized,
-{
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "{}", truncate(&self.1, self.0))
- }
-}
-
-#[cfg(test)]
-mod test {
- use super::*;
- use crate::insight_context_log::InsightContextLog;
-
- #[test]
- fn test_truncate() {
- let truncated = Truncate(3, "123456789").to_string();
- assert_eq!(truncated.as_str(), "123...");
- assert_eq!(
- Truncate(5, "hello world").to_string(),
- "hello...".to_string()
- );
- }
-
- #[test]
- fn test_indent() {
- let text = "this is text";
- assert_eq!(" this is text".to_string(), Indent(4, text).to_string());
- let text = r#"multi
-line
-text
- here"#;
- assert_eq!(
- r#" multi
- line
- text
- here"#
- .to_string(),
- Indent(4, text).to_string()
- );
- }
-
- #[test]
- fn test_log() {
- let log = InsightContextLog {
- content: "content",
- metadata: vec![("key".to_string(), "value".to_string())],
- name: "test".to_string(),
- };
- let text = log.to_string();
- assert_eq!(
- r#"[test]
-key: value
-content
-[END test]
-"#,
- text.as_str()
- );
-
- let log = InsightContextLog {
- content: Truncate(7, "content that is too long to be useful to ai"),
- metadata: vec![],
- name: "long test".to_string(),
- };
- assert_eq!(
- log.to_string(),
- r#"[long test]
-content...
-[END long test]
-"#
- .to_string()
- );
-
- let nested_log = InsightContextLog {
- content: Indent(4, log),
- metadata: vec![("swag".to_string(), "true".to_string())],
- name: "nested test".to_string(),
- };
-
- assert_eq!(
- r#"[nested test]
-swag: true
- [long test]
- content...
- [END long test]
-[END nested test]
-"#
- .to_string(),
- nested_log.to_string()
- )
- }
-}
diff --git a/rust/cloud-storage/ai_tools/Cargo.toml b/rust/cloud-storage/ai_tools/Cargo.toml
index b1e384ba38..d322514666 100644
--- a/rust/cloud-storage/ai_tools/Cargo.toml
+++ b/rust/cloud-storage/ai_tools/Cargo.toml
@@ -9,7 +9,6 @@ test-support = []
[dependencies]
ai = { path = "../ai" }
-ai_format = { path = "../ai_format" }
attachment = { path = "../attachment" }
non_empty = { path = "../non_empty" }
ai_toolset = { path = "../ai_toolset" }
diff --git a/rust/cloud-storage/ai_tools/src/schemas/read.rs b/rust/cloud-storage/ai_tools/src/schemas/read.rs
index b684a0bc1e..6bf84b2589 100644
--- a/rust/cloud-storage/ai_tools/src/schemas/read.rs
+++ b/rust/cloud-storage/ai_tools/src/schemas/read.rs
@@ -12,9 +12,6 @@ pub struct ReadResponse {
pub content: ReadContent,
}
-// TODO: this should be hoisted to "ai_format" so that consistent formats can be used everywhere
-// TODO: tool calls should be formatted with xml tags not json
-// TODO: We should minimize nested context
#[derive(Debug, JsonSchema, Serialize, Clone)]
#[serde(rename_all = "camelCase")]
#[serde(tag = "type")]
diff --git a/rust/cloud-storage/comms_service/Cargo.toml b/rust/cloud-storage/comms_service/Cargo.toml
index 90b3a38f5c..206452153a 100644
--- a/rust/cloud-storage/comms_service/Cargo.toml
+++ b/rust/cloud-storage/comms_service/Cargo.toml
@@ -19,7 +19,6 @@ local_auth = []
service = ["comms_db_client"]
[dependencies]
-ai_format = { path = "../ai_format" }
anyhow = { workspace = true }
async-trait = { workspace = true }
aws-sdk-secretsmanager = { workspace = true }
diff --git a/rust/cloud-storage/comms_service/src/api/channels/get_channel_transcript.rs b/rust/cloud-storage/comms_service/src/api/channels/get_channel_transcript.rs
deleted file mode 100644
index ed679151b4..0000000000
--- a/rust/cloud-storage/comms_service/src/api/channels/get_channel_transcript.rs
+++ /dev/null
@@ -1,90 +0,0 @@
-use crate::api::{
- context::AppState,
- extractors::{ChannelId, ChannelMember},
-};
-use ai_format::insight_context_log::InsightContextLog;
-use ai_format::util::Indent;
-use axum::{
- extract::{Query, State},
- http::StatusCode,
- response::{IntoResponse, Json, Response},
-};
-use axum_extra::extract::Cached;
-use comms_db_client::messages::get_messages::get_messages;
-use serde::{Deserialize, Serialize};
-use sqlx::Pool;
-use utoipa::ToSchema;
-use uuid::Uuid;
-
-#[derive(Debug, Serialize, Deserialize, ToSchema)]
-pub struct ChannelTranscriptResponse {
- pub transcript: String,
-}
-
-#[derive(Debug, Deserialize)]
-pub struct GetChannelTranscriptQuery {
- pub since: Option<chrono::DateTime<chrono::Utc>>,
- pub limit: Option<i64>,
-}
-
-pub async fn get_channel_transcript(
- db: &Pool<sqlx::Postgres>,
- channel_id: &Uuid,
- since: Option<chrono::DateTime<chrono::Utc>>,
- limit: Option<i64>,
-) -> anyhow::Result<String> {
- // If both since and limit are None, fetch all messages (original behavior)
- let messages = get_messages(db, channel_id, since, limit).await?;
-
- let formatted_messages = messages
- .iter()
- .map(|msg| {
- InsightContextLog {
- name: "message".to_string(),
- metadata: vec![
- ("sender_id".to_string(), msg.sender_id.to_string()),
- ("created_at".to_string(), msg.created_at.to_rfc3339()),
- ],
- content: msg.content.clone(),
- }
- .to_string()
- })
- .collect::<Vec<_>>()
- .join("\n");
-
- let formatted_text = InsightContextLog {
- name: "conversation".to_string(),
- metadata: vec![],
- content: Indent(4, formatted_messages),
- }
- .to_string();
-
- let prompt = "The following conversation is limited to the last 1000 messages. Ignore all formatting and do not show the user the formatted conversation.";
- let formatted_messages = format!("{}\n\n{}", prompt, formatted_text);
-
- Ok(formatted_messages)
-}
-
-/// External handler with channel access middleware
-#[tracing::instrument(skip(ctx))]
-pub async fn handler_external(
- State(ctx): State<AppState>,
- ChannelMember(_channel_member): ChannelMember,
- Cached(ChannelId(channel_id)): Cached<ChannelId>,
- Query(query): Query<GetChannelTranscriptQuery>,
-) -> Result<Response, Response> {
- let transcript = get_channel_transcript(&ctx.db, &channel_id, query.since, query.limit)
- .await
- .map_err(|e| {
- tracing::error!(error=?e, "unable to get channel transcript");
- (
- StatusCode::INTERNAL_SERVER_ERROR,
- "unable to get channel transcript",
- )
- .into_response()
- })?;
-
- let response = ChannelTranscriptResponse { transcript };
-
- Ok((StatusCode::OK, Json(response)).into_response())
-}
diff --git a/rust/cloud-storage/comms_service/src/api/channels/mod.rs b/rust/cloud-storage/comms_service/src/api/channels/mod.rs
index 8488fe7436..03491ac322 100644
--- a/rust/cloud-storage/comms_service/src/api/channels/mod.rs
+++ b/rust/cloud-storage/comms_service/src/api/channels/mod.rs
@@ -9,7 +9,6 @@ pub mod delete_channel;
pub mod delete_message;
pub mod get_channel;
pub mod get_channel_metadata;
-pub mod get_channel_transcript;
pub mod get_mentions;
pub mod get_message_with_context;
pub mod get_or_create_dm;
@@ -79,9 +78,5 @@ pub fn router() -> Router<AppState> {
"/{channel_id}/metadata",
get(get_channel_metadata::handler_external),
)
- .route(
- "/{channel_id}/transcript",
- get(get_channel_transcript::handler_external),
- )
.route("/messages/context", get(get_message_with_context::handler))
}
diff --git a/rust/cloud-storage/document_cognition_service/Cargo.toml b/rust/cloud-storage/document_cognition_service/Cargo.toml
index 801f785d47..94d1655992 100644
--- a/rust/cloud-storage/document_cognition_service/Cargo.toml
+++ b/rust/cloud-storage/document_cognition_service/Cargo.toml
@@ -26,7 +26,6 @@ local_queue = []
[dependencies]
aho-corasick = "1.1.3"
ai = { path = "../ai" }
-ai_format = { path = "../ai_format" }
attachment = { path = "../attachment", features = ["provider"] }
non_empty = { path = "../non_empty" }
ai_tools = { path = "../ai_tools" }
diff --git a/rust/cloud-storage/model/Cargo.toml b/rust/cloud-storage/model/Cargo.toml
index db6950fe77..a83472e384 100644
--- a/rust/cloud-storage/model/Cargo.toml
+++ b/rust/cloud-storage/model/Cargo.toml
@@ -6,7 +6,6 @@ version = "0.1.0"
[dependencies]
ai = { path = "../ai" }
-ai_format = { path = "../ai_format" }
anyhow = { workspace = true }
axum = { workspace = true }
base64 = { workspace = true }