openai_struct/models/
chat_completion_request_system_message.rs

1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https:///platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https:///github.com/swagger-api/swagger-codegen.git
9 */
10
11/// pub ChatCompletionRequestSystemMessage : Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, use `developer` messages for this purpose instead.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// ChatCompletionRequestSystemMessage:
20///   type: object
21///   title: System message
22///   description: >
23///     Developer-provided instructions that the model should follow, regardless
24///     of
25///
26///     messages sent by the user. With o1 models and newer, use `developer`
27///     messages
28///
29///     for this purpose instead.
30///   properties:
31///     content:
32///       description: The contents of the system message.
33///       oneOf:
34///         - type: string
35///           description: The contents of the system message.
36///           title: Text content
37///         - type: array
38///           description:
39///             An array of content parts with a defined type. For system messages,
40///             only type `text` is supported.
41///           title: Array of content parts
42///           items:
43///             $ref: "#/components/schemas/ChatCompletionRequestSystemMessageContentPart"
44///           minItems: 1
45///     role:
46///       type: string
47///       enum:
48///         - system
49///       description: The role of the messages author, in this case `system`.
50///       x-stainless-const: true
51///     name:
52///       type: string
53///       description: An optional name for the participant. Provides the model
54///         information to differentiate between participants of the same role.
55///   required:
56///     - content
57///     - role
58/// ```
59#[derive(Debug, Serialize, Deserialize, PartialEq)]
60pub struct ChatCompletionRequestSystemMessage {
61    /// The contents of the system message.
62    #[serde(rename = "content")]
63    pub content: ChatCompletionRequestSystemMessageContent,
64    /// An optional name for the participant. Provides the model information to differentiate between participants of the same role.
65    #[serde(rename = "name")]
66    pub name: Option<String>,
67}
68
69#[derive(Debug, Serialize, Deserialize, PartialEq)]
70#[serde(untagged)]
71pub enum ChatCompletionRequestSystemMessageContent {
72    Text(String),
73    Array(Vec<crate::ChatCompletionRequestSystemMessageContentPart>),
74}