#[non_exhaustive]pub struct FewShotExample {
pub conversation_context: Option<ConversationContext>,
pub extra_info: HashMap<String, String>,
pub output: Option<GeneratorSuggestion>,
pub instruction_list: Option<InstructionList>,
/* private fields */
}conversations or generator-evaluations or generators only.Expand description
Providing examples in the generator (i.e. building a few-shot generator) helps convey the desired format of the LLM response.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.conversation_context: Option<ConversationContext>Optional. Conversation transcripts.
extra_info: HashMap<String, String>Optional. Key is the placeholder field name in input, value is the value of the placeholder. E.g. instruction contains “@price”, and ingested data has <“price”, “10”>
output: Option<GeneratorSuggestion>Required. Example output of the model.
instruction_list: Option<InstructionList>Instruction list of this few_shot example.
Implementations§
Source§impl FewShotExample
impl FewShotExample
Sourcepub fn set_conversation_context<T>(self, v: T) -> Selfwhere
T: Into<ConversationContext>,
pub fn set_conversation_context<T>(self, v: T) -> Selfwhere
T: Into<ConversationContext>,
Sets the value of conversation_context.
§Example
use google_cloud_dialogflow_v2::model::ConversationContext;
let x = FewShotExample::new().set_conversation_context(ConversationContext::default()/* use setters */);Sourcepub fn set_or_clear_conversation_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<ConversationContext>,
pub fn set_or_clear_conversation_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<ConversationContext>,
Sets or clears the value of conversation_context.
§Example
use google_cloud_dialogflow_v2::model::ConversationContext;
let x = FewShotExample::new().set_or_clear_conversation_context(Some(ConversationContext::default()/* use setters */));
let x = FewShotExample::new().set_or_clear_conversation_context(None::<ConversationContext>);Sourcepub fn set_extra_info<T, K, V>(self, v: T) -> Self
pub fn set_extra_info<T, K, V>(self, v: T) -> Self
Sets the value of extra_info.
§Example
let x = FewShotExample::new().set_extra_info([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_output<T>(self, v: T) -> Selfwhere
T: Into<GeneratorSuggestion>,
pub fn set_output<T>(self, v: T) -> Selfwhere
T: Into<GeneratorSuggestion>,
Sourcepub fn set_or_clear_output<T>(self, v: Option<T>) -> Selfwhere
T: Into<GeneratorSuggestion>,
pub fn set_or_clear_output<T>(self, v: Option<T>) -> Selfwhere
T: Into<GeneratorSuggestion>,
Sourcepub fn set_instruction_list<T: Into<Option<InstructionList>>>(
self,
v: T,
) -> Self
pub fn set_instruction_list<T: Into<Option<InstructionList>>>( self, v: T, ) -> Self
Sets the value of instruction_list.
Note that all the setters affecting instruction_list are mutually
exclusive.
§Example
use google_cloud_dialogflow_v2::model::SummarizationSectionList;
let x = FewShotExample::new().set_instruction_list(Some(
google_cloud_dialogflow_v2::model::few_shot_example::InstructionList::SummarizationSectionList(SummarizationSectionList::default().into())));Sourcepub fn summarization_section_list(
&self,
) -> Option<&Box<SummarizationSectionList>>
pub fn summarization_section_list( &self, ) -> Option<&Box<SummarizationSectionList>>
The value of instruction_list
if it holds a SummarizationSectionList, None if the field is not set or
holds a different branch.
Sourcepub fn set_summarization_section_list<T: Into<Box<SummarizationSectionList>>>(
self,
v: T,
) -> Self
pub fn set_summarization_section_list<T: Into<Box<SummarizationSectionList>>>( self, v: T, ) -> Self
Sets the value of instruction_list
to hold a SummarizationSectionList.
Note that all the setters affecting instruction_list are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::SummarizationSectionList;
let x = FewShotExample::new().set_summarization_section_list(SummarizationSectionList::default()/* use setters */);
assert!(x.summarization_section_list().is_some());Trait Implementations§
Source§impl Clone for FewShotExample
impl Clone for FewShotExample
Source§fn clone(&self) -> FewShotExample
fn clone(&self) -> FewShotExample
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FewShotExample
impl Debug for FewShotExample
Source§impl Default for FewShotExample
impl Default for FewShotExample
Source§fn default() -> FewShotExample
fn default() -> FewShotExample
Source§impl Message for FewShotExample
impl Message for FewShotExample
Source§impl PartialEq for FewShotExample
impl PartialEq for FewShotExample
impl StructuralPartialEq for FewShotExample
Auto Trait Implementations§
impl Freeze for FewShotExample
impl RefUnwindSafe for FewShotExample
impl Send for FewShotExample
impl Sync for FewShotExample
impl Unpin for FewShotExample
impl UnsafeUnpin for FewShotExample
impl UnwindSafe for FewShotExample
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request