pub struct ChatCompletionRequestSystemMessageArgs { /* private fields */ }Expand description
Builder for ChatCompletionRequestSystemMessage.
Implementations§
Source§impl ChatCompletionRequestSystemMessageArgs
impl ChatCompletionRequestSystemMessageArgs
pub fn content<VALUE: Into<ChatCompletionRequestSystemMessageContent>>( &mut self, value: VALUE, ) -> &mut Self
pub fn name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Sourcepub fn tools<VALUE: Into<Vec<Value>>>(&mut self, value: VALUE) -> &mut Self
pub fn tools<VALUE: Into<Vec<Value>>>(&mut self, value: VALUE) -> &mut Self
Kimi-style dynamic tool metadata carried on a system message.
Moonshot treats omitted, null, and empty content as no system text;
renderers enforce that non-empty content and tools are mutually
exclusive and that tools is non-empty. The list shape is typed here
so non-array values are rejected at deserialization.
Entries stay raw JSON rather than a typed schema on purpose: this crate
only needs to preserve them for downstream chat-template rendering,
which reads them back as generic JSON by key. A typed entry (e.g.
FunctionObject) would silently drop vendor-specific keys serde doesn’t
know about on round-trip, whereas serde_json::Value is structurally
lossless (JSON structure and unknown keys survive; whitespace, number
spelling, and duplicate keys do not).
Kimi’s encoding_k3.py renders this through the same tool-declare path
as the top-level tools field and never inspects individual entries, so
the canonical shape is the same OpenAI wrapped form,
{"type": "function", "function": {...}}. Clients that send bare
function-schema objects ({"name": ..., "parameters": ...}) are passed
through unchanged as well; this crate takes no position on the shape.
Sourcepub fn build(&self) -> Result<ChatCompletionRequestSystemMessage, OpenAIError>
pub fn build(&self) -> Result<ChatCompletionRequestSystemMessage, OpenAIError>
Builds a new ChatCompletionRequestSystemMessage.
§Errors
If a required field has not been initialized.
Trait Implementations§
Source§impl Clone for ChatCompletionRequestSystemMessageArgs
impl Clone for ChatCompletionRequestSystemMessageArgs
Source§fn clone(&self) -> ChatCompletionRequestSystemMessageArgs
fn clone(&self) -> ChatCompletionRequestSystemMessageArgs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more