openai_struct/models/chat_completion_role.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 ChatCompletionRole : The role of the author of a message
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// ChatCompletionRole:
20/// type: string
21/// description: The role of the author of a message
22/// enum:
23/// - developer
24/// - system
25/// - user
26/// - assistant
27/// - tool
28/// - function
29/// ```
30#[derive(Debug, Serialize, Deserialize)]
31#[serde(rename_all = "snake_case")]
32pub enum ChatCompletionRole {
33 Developer,
34 System,
35 User,
36 Assistant,
37 Tool,
38 Function,
39}
40
41#[test]
42fn test_role() {
43 assert_eq!(
44 serde_json::to_string(&ChatCompletionRole::Developer).unwrap(),
45 r#""developer""#
46 );
47}