mirror of https://github.com/dapr/rust-sdk.git
refactor(conversations): rename message to content (#261)
Signed-off-by: Mike Nguyen <hey@mike.ee>
This commit is contained in:
parent
57347e70c3
commit
ab219049a4
|
@ -1093,7 +1093,7 @@ impl JobBuilder {
|
|||
}
|
||||
|
||||
pub struct ConversationInputBuilder {
|
||||
message: String,
|
||||
content: String,
|
||||
role: Option<String>,
|
||||
scrub_pii: Option<bool>,
|
||||
}
|
||||
|
@ -1101,7 +1101,7 @@ pub struct ConversationInputBuilder {
|
|||
impl ConversationInputBuilder {
|
||||
pub fn new(message: &str) -> Self {
|
||||
ConversationInputBuilder {
|
||||
message: message.to_string(),
|
||||
content: message.to_string(),
|
||||
role: None,
|
||||
scrub_pii: None,
|
||||
}
|
||||
|
@ -1109,7 +1109,7 @@ impl ConversationInputBuilder {
|
|||
|
||||
pub fn build(self) -> ConversationInput {
|
||||
ConversationInput {
|
||||
message: self.message,
|
||||
content: self.content,
|
||||
role: self.role,
|
||||
scrub_pii: self.scrub_pii,
|
||||
}
|
||||
|
|
|
@ -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>,
|
||||
|
|
Binary file not shown.
|
@ -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?;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue