diff --git a/crates/artificial-core/Cargo.toml b/crates/artificial-core/Cargo.toml index d7a27b1..5972d2f 100644 --- a/crates/artificial-core/Cargo.toml +++ b/crates/artificial-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "artificial-core" -version = "0.4.0" +version = "0.4.1" edition = "2021" description = "Provider-agnostic core traits, generic client and error types for the Artificial prompt-engineering SDK" license = "MIT" diff --git a/crates/artificial-core/src/client.rs b/crates/artificial-core/src/client.rs index 245b1e7..0c7a64b 100644 --- a/crates/artificial-core/src/client.rs +++ b/crates/artificial-core/src/client.rs @@ -99,7 +99,7 @@ impl ChatCompletionProvider for ArtificialClient { >, > where - M: Into + Send + Sync + 'p, + M: Into + Clone + Send + Sync + 'p, { self.backend.chat_complete(params) } @@ -113,7 +113,7 @@ impl StreamingChatProvider for ArtificialClient { fn chat_complete_stream<'p, M>(&self, params: ChatCompleteParameters) -> Self::Delta<'p> where - M: Into + Send + Sync + 'p, + M: Into + Clone + Send + Sync + 'p, { self.backend.chat_complete_stream(params) } @@ -130,7 +130,7 @@ impl StreamingEventsProvider for ArtificialClient params: crate::provider::ChatCompleteParameters, ) -> Self::EventStream<'p> where - M: Into + Send + Sync + 'p, + M: Into + Clone + Send + Sync + 'p, { self.backend.chat_complete_events_stream(params) } diff --git a/crates/artificial-core/src/generic.rs b/crates/artificial-core/src/generic.rs index fa7c773..42d56e8 100644 --- a/crates/artificial-core/src/generic.rs +++ b/crates/artificial-core/src/generic.rs @@ -194,5 +194,5 @@ pub trait StreamingEventsProvider: crate::provider::ChatCompletionProvider { params: crate::provider::ChatCompleteParameters, ) -> Self::EventStream<'p> where - M: Into + Send + Sync + 'p; + M: Into + Clone + Send + Sync + 'p; } diff --git a/crates/artificial-core/src/provider/chat_complete.rs b/crates/artificial-core/src/provider/chat_complete.rs index 41fcdfd..b979604 100644 --- a/crates/artificial-core/src/provider/chat_complete.rs +++ b/crates/artificial-core/src/provider/chat_complete.rs @@ -30,7 +30,7 @@ pub trait ChatCompletionProvider: Send + Sync { Box>> + Send + 'p>, > where - M: Into + Send + Sync + 'p; + M: Into + Clone + Send + Sync + 'p; } /// A provider that can deliver the model’s answer **incrementally**. @@ -49,11 +49,11 @@ pub trait StreamingChatProvider: ChatCompletionProvider { /// Start a streaming chat completion. fn chat_complete_stream<'p, M>(&self, params: ChatCompleteParameters) -> Self::Delta<'p> where - M: Into + Send + Sync + 'p; + M: Into + Clone + Send + Sync + 'p; } #[derive(Debug, Clone)] -pub struct ChatCompleteParameters { +pub struct ChatCompleteParameters { pub messages: Vec, pub model: Model, pub tools: Option>, @@ -61,7 +61,7 @@ pub struct ChatCompleteParameters { pub response_format: Option, } -impl ChatCompleteParameters { +impl ChatCompleteParameters { pub fn new(messages: Vec, model: Model) -> Self { Self { messages, diff --git a/crates/artificial-openai/Cargo.toml b/crates/artificial-openai/Cargo.toml index a3a1c43..82d16d2 100644 --- a/crates/artificial-openai/Cargo.toml +++ b/crates/artificial-openai/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "artificial-openai" -version = "0.4.0" +version = "0.4.1" edition = "2024" description = "OpenAI backend adapter for the Artificial prompt-engineering SDK" license = "MIT" @@ -24,7 +24,7 @@ reqwest = { version = "0.12", default-features = false, features = [ "deflate", "multipart", ] } -artificial-core = { path = "../artificial-core" , version = "0.4.0"} +artificial-core = { path = "../artificial-core" , version = "0.4.1"} futures-util = "0.3" async-stream = "0.3" bytes = "1" diff --git a/crates/artificial-openai/src/api_v1/chat_completion.rs b/crates/artificial-openai/src/api_v1/chat_completion.rs index 49f19e5..6791c0e 100644 --- a/crates/artificial-openai/src/api_v1/chat_completion.rs +++ b/crates/artificial-openai/src/api_v1/chat_completion.rs @@ -55,7 +55,7 @@ impl_builder_methods!( impl TryFrom> for ChatCompletionRequest where - M: Into, + M: Into + Clone, { type Error = ArtificialError; diff --git a/crates/artificial-openai/src/provider_impl_chat.rs b/crates/artificial-openai/src/provider_impl_chat.rs index 59bae45..8c44c03 100644 --- a/crates/artificial-openai/src/provider_impl_chat.rs +++ b/crates/artificial-openai/src/provider_impl_chat.rs @@ -30,7 +30,7 @@ impl ChatCompletionProvider for OpenAiAdapter { >, > where - M: Into + Send + Sync + 'p, + M: Into + Clone + Send + Sync + 'p, { let client = Arc::clone(&self.client); diff --git a/crates/artificial-openai/src/provider_impl_chat_stream.rs b/crates/artificial-openai/src/provider_impl_chat_stream.rs index 4be31d5..427e107 100644 --- a/crates/artificial-openai/src/provider_impl_chat_stream.rs +++ b/crates/artificial-openai/src/provider_impl_chat_stream.rs @@ -18,7 +18,7 @@ impl StreamingChatProvider for OpenAiAdapter { fn chat_complete_stream<'p, M>(&self, params: ChatCompleteParameters) -> Self::Delta<'p> where - M: Into + Send + Sync + 'p, + M: Into + Clone + Send + Sync + 'p, { let client = self.client.clone(); @@ -55,7 +55,7 @@ impl StreamingEventsProvider for OpenAiAdapter { params: ChatCompleteParameters, ) -> Self::EventStream<'p> where - M: Into + Send + Sync + 'p, + M: Into + Clone + Send + Sync + 'p, { let client = self.client.clone(); diff --git a/crates/artificial-prompt/Cargo.toml b/crates/artificial-prompt/Cargo.toml index 615211b..cef8081 100644 --- a/crates/artificial-prompt/Cargo.toml +++ b/crates/artificial-prompt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "artificial-prompt" -version = "0.4.0" +version = "0.4.1" edition = "2024" description = "Fluent builders and helpers for composing markdown prompt fragments" license = "MIT" @@ -9,4 +9,4 @@ categories = ["development-tools", "text-processing"] keywords = ["ai", "prompt", "markdown", "builder"] [dependencies] -artificial-core = { path = "../artificial-core" , version = "0.4.0"} +artificial-core = { path = "../artificial-core" , version = "0.4.1"} diff --git a/crates/artificial-types/Cargo.toml b/crates/artificial-types/Cargo.toml index da6935d..51adc56 100644 --- a/crates/artificial-types/Cargo.toml +++ b/crates/artificial-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "artificial-types" -version = "0.4.0" +version = "0.4.1" edition = "2024" description = "Reusable prompt fragments and helper types for the Artificial prompt-engineering SDK" license = "MIT" @@ -9,8 +9,8 @@ categories = ["development-tools", "text-processing"] keywords = ["ai", "prompt-fragments", "json-schema", "sdk"] [dependencies] -artificial-core = { path = "../artificial-core" , version = "0.4.0"} -artificial-prompt = { path = "../artificial-prompt" , version = "0.4.0"} +artificial-core = { path = "../artificial-core" , version = "0.4.1"} +artificial-prompt = { path = "../artificial-prompt" , version = "0.4.1"} chrono = "0.4.41" schemars.workspace = true diff --git a/crates/artificial/Cargo.toml b/crates/artificial/Cargo.toml index f263181..d4e0d97 100644 --- a/crates/artificial/Cargo.toml +++ b/crates/artificial/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "artificial" -version = "0.4.0" +version = "0.4.1" edition = "2024" description = "Typed, provider-agnostic prompt-engineering SDK for Rust" authors = ["Marc Riegel "] @@ -15,10 +15,10 @@ default = ["openai"] openai = ["dep:artificial-openai"] [dependencies] -artificial-types = { path = "../artificial-types", version = "0.4.0" } -artificial-openai = { path = "../artificial-openai", optional = true, version = "0.4.0" } -artificial-core = { path = "../artificial-core", version = "0.4.0" } -artificial-prompt = { path = "../artificial-prompt", version = "0.4.0" } +artificial-types = { path = "../artificial-types", version = "0.4.1" } +artificial-openai = { path = "../artificial-openai", optional = true, version = "0.4.1" } +artificial-core = { path = "../artificial-core", version = "0.4.1" } +artificial-prompt = { path = "../artificial-prompt", version = "0.4.1" } [dev-dependencies] tokio = { version = "1", features = ["full"] }