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 {
|
pub struct ConversationInputBuilder {
|
||||||
message: String,
|
content: String,
|
||||||
role: Option<String>,
|
role: Option<String>,
|
||||||
scrub_pii: Option<bool>,
|
scrub_pii: Option<bool>,
|
||||||
}
|
}
|
||||||
|
@ -1101,7 +1101,7 @@ pub struct ConversationInputBuilder {
|
||||||
impl ConversationInputBuilder {
|
impl ConversationInputBuilder {
|
||||||
pub fn new(message: &str) -> Self {
|
pub fn new(message: &str) -> Self {
|
||||||
ConversationInputBuilder {
|
ConversationInputBuilder {
|
||||||
message: message.to_string(),
|
content: message.to_string(),
|
||||||
role: None,
|
role: None,
|
||||||
scrub_pii: None,
|
scrub_pii: None,
|
||||||
}
|
}
|
||||||
|
@ -1109,7 +1109,7 @@ impl ConversationInputBuilder {
|
||||||
|
|
||||||
pub fn build(self) -> ConversationInput {
|
pub fn build(self) -> ConversationInput {
|
||||||
ConversationInput {
|
ConversationInput {
|
||||||
message: self.message,
|
content: self.content,
|
||||||
role: self.role,
|
role: self.role,
|
||||||
scrub_pii: self.scrub_pii,
|
scrub_pii: self.scrub_pii,
|
||||||
}
|
}
|
||||||
|
|
|
@ -3261,9 +3261,9 @@ pub struct ConversationRequest {
|
||||||
}
|
}
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct ConversationInput {
|
pub struct ConversationInput {
|
||||||
/// The message to send to the llm
|
/// The content to send to the llm
|
||||||
#[prost(string, tag = "1")]
|
#[prost(string, tag = "1")]
|
||||||
pub message: ::prost::alloc::string::String,
|
pub content: ::prost::alloc::string::String,
|
||||||
/// The role to set for the message
|
/// The role to set for the message
|
||||||
#[prost(string, optional, tag = "2")]
|
#[prost(string, optional, tag = "2")]
|
||||||
pub role: ::core::option::Option<::prost::alloc::string::String>,
|
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 =
|
let request =
|
||||||
ConversationRequestBuilder::new(conversation_component, vec![input.clone()]).build();
|
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?;
|
let response = client.converse_alpha1(request).await?;
|
||||||
|
|
||||||
|
|
|
@ -1319,8 +1319,8 @@ message ConversationRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message ConversationInput {
|
message ConversationInput {
|
||||||
// The message to send to the llm
|
// The content to send to the llm
|
||||||
string message = 1;
|
string content = 1;
|
||||||
|
|
||||||
// The role to set for the message
|
// The role to set for the message
|
||||||
optional string role = 2;
|
optional string role = 2;
|
||||||
|
|
Loading…
Reference in New Issue