Skip to content

Commit

Permalink
refactor(conversations): rename message to content (#261)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Nguyen <[email protected]>
  • Loading branch information
mikeee authored Feb 24, 2025
1 parent 57347e7 commit ab21904
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dapr/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,23 +1093,23 @@ impl JobBuilder {
}

pub struct ConversationInputBuilder {
message: String,
content: String,
role: Option<String>,
scrub_pii: Option<bool>,
}

impl ConversationInputBuilder {
pub fn new(message: &str) -> Self {
ConversationInputBuilder {
message: message.to_string(),
content: message.to_string(),
role: None,
scrub_pii: None,
}
}

pub fn build(self) -> ConversationInput {
ConversationInput {
message: self.message,
content: self.content,
role: self.role,
scrub_pii: self.scrub_pii,
}
Expand Down
4 changes: 2 additions & 2 deletions dapr/src/dapr/dapr.proto.runtime.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3261,9 +3261,9 @@ pub struct ConversationRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConversationInput {
/// The message to send to the llm
/// The content to send to the llm
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
pub content: ::prost::alloc::string::String,
/// The role to set for the message
#[prost(string, optional, tag = "2")]
pub role: ::core::option::Option<::prost::alloc::string::String>,
Expand Down
Binary file modified dapr/src/dapr/types.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/src/conversation/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let request =
ConversationRequestBuilder::new(conversation_component, vec![input.clone()]).build();

println!("conversation input: {:?}", input.message);
println!("conversation input: {:?}", input.content);

let response = client.converse_alpha1(request).await?;

Expand Down
4 changes: 2 additions & 2 deletions proto/dapr/proto/runtime/v1/dapr.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1319,8 +1319,8 @@ message ConversationRequest {
}

message ConversationInput {
// The message to send to the llm
string message = 1;
// The content to send to the llm
string content = 1;

// The role to set for the message
optional string role = 2;
Expand Down

0 comments on commit ab21904

Please sign in to comment.