Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/artificial-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 3 additions & 3 deletions crates/artificial-core/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl<B: ChatCompletionProvider> ChatCompletionProvider for ArtificialClient<B> {
>,
>
where
M: Into<Self::Message> + Send + Sync + 'p,
M: Into<Self::Message> + Clone + Send + Sync + 'p,
{
self.backend.chat_complete(params)
}
Expand All @@ -113,7 +113,7 @@ impl<B: StreamingChatProvider> StreamingChatProvider for ArtificialClient<B> {

fn chat_complete_stream<'p, M>(&self, params: ChatCompleteParameters<M>) -> Self::Delta<'p>
where
M: Into<Self::Message> + Send + Sync + 'p,
M: Into<Self::Message> + Clone + Send + Sync + 'p,
{
self.backend.chat_complete_stream(params)
}
Expand All @@ -130,7 +130,7 @@ impl<B: StreamingEventsProvider> StreamingEventsProvider for ArtificialClient<B>
params: crate::provider::ChatCompleteParameters<M>,
) -> Self::EventStream<'p>
where
M: Into<Self::Message> + Send + Sync + 'p,
M: Into<Self::Message> + Clone + Send + Sync + 'p,
{
self.backend.chat_complete_events_stream(params)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/artificial-core/src/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,5 @@ pub trait StreamingEventsProvider: crate::provider::ChatCompletionProvider {
params: crate::provider::ChatCompleteParameters<M>,
) -> Self::EventStream<'p>
where
M: Into<Self::Message> + Send + Sync + 'p;
M: Into<Self::Message> + Clone + Send + Sync + 'p;
}
8 changes: 4 additions & 4 deletions crates/artificial-core/src/provider/chat_complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub trait ChatCompletionProvider: Send + Sync {
Box<dyn Future<Output = Result<GenericChatCompletionResponse<GenericMessage>>> + Send + 'p>,
>
where
M: Into<Self::Message> + Send + Sync + 'p;
M: Into<Self::Message> + Clone + Send + Sync + 'p;
}

/// A provider that can deliver the model’s answer **incrementally**.
Expand All @@ -49,19 +49,19 @@ pub trait StreamingChatProvider: ChatCompletionProvider {
/// Start a streaming chat completion.
fn chat_complete_stream<'p, M>(&self, params: ChatCompleteParameters<M>) -> Self::Delta<'p>
where
M: Into<Self::Message> + Send + Sync + 'p;
M: Into<Self::Message> + Clone + Send + Sync + 'p;
}

#[derive(Debug, Clone)]
pub struct ChatCompleteParameters<M> {
pub struct ChatCompleteParameters<M: Clone> {
pub messages: Vec<M>,
pub model: Model,
pub tools: Option<Vec<GenericFunctionSpec>>,
pub temperature: Option<f64>,
pub response_format: Option<serde_json::Value>,
}

impl<M> ChatCompleteParameters<M> {
impl<M: Clone> ChatCompleteParameters<M> {
pub fn new(messages: Vec<M>, model: Model) -> Self {
Self {
messages,
Expand Down
4 changes: 2 additions & 2 deletions crates/artificial-openai/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
2 changes: 1 addition & 1 deletion crates/artificial-openai/src/api_v1/chat_completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl_builder_methods!(

impl<M> TryFrom<ChatCompleteParameters<M>> for ChatCompletionRequest
where
M: Into<ChatCompletionMessage>,
M: Into<ChatCompletionMessage> + Clone,
{
type Error = ArtificialError;

Expand Down
2 changes: 1 addition & 1 deletion crates/artificial-openai/src/provider_impl_chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl ChatCompletionProvider for OpenAiAdapter {
>,
>
where
M: Into<Self::Message> + Send + Sync + 'p,
M: Into<Self::Message> + Clone + Send + Sync + 'p,
{
let client = Arc::clone(&self.client);

Expand Down
4 changes: 2 additions & 2 deletions crates/artificial-openai/src/provider_impl_chat_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl StreamingChatProvider for OpenAiAdapter {

fn chat_complete_stream<'p, M>(&self, params: ChatCompleteParameters<M>) -> Self::Delta<'p>
where
M: Into<Self::Message> + Send + Sync + 'p,
M: Into<Self::Message> + Clone + Send + Sync + 'p,
{
let client = self.client.clone();

Expand Down Expand Up @@ -55,7 +55,7 @@ impl StreamingEventsProvider for OpenAiAdapter {
params: ChatCompleteParameters<M>,
) -> Self::EventStream<'p>
where
M: Into<Self::Message> + Send + Sync + 'p,
M: Into<Self::Message> + Clone + Send + Sync + 'p,
{
let client = self.client.clone();

Expand Down
4 changes: 2 additions & 2 deletions crates/artificial-prompt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"}
6 changes: 3 additions & 3 deletions crates/artificial-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions crates/artificial/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <mail@mrcrgl.de>"]
Expand All @@ -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"] }
Expand Down
Loading