langfuse_client/models/
create_comment_request.rs

1/*
2 * langfuse
3 *
4 * ## Authentication  Authenticate with the API using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication), get API keys in the project settings:  - username: Langfuse Public Key - password: Langfuse Secret Key  ## Exports  - OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml - Postman collection: https://cloud.langfuse.com/generated/postman/collection.json
5 *
6 * The version of the OpenAPI document: 
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15#[cfg_attr(feature="bon", derive(bon::Builder))]
16pub struct CreateCommentRequest {
17    /// The id of the project to attach the comment to.
18    #[serde(rename = "projectId")]
19    pub project_id: String,
20    /// The type of the object to attach the comment to (trace, observation, session, prompt).
21    #[serde(rename = "objectType")]
22    pub object_type: String,
23    /// The id of the object to attach the comment to. If this does not reference a valid existing object, an error will be thrown.
24    #[serde(rename = "objectId")]
25    pub object_id: String,
26    /// The content of the comment. May include markdown. Currently limited to 3000 characters.
27    #[serde(rename = "content")]
28    pub content: String,
29    /// The id of the user who created the comment.
30    #[serde(rename = "authorUserId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub author_user_id: Option<Option<String>>,
32}
33
34impl CreateCommentRequest {
35    pub fn new(project_id: String, object_type: String, object_id: String, content: String) -> CreateCommentRequest {
36        CreateCommentRequest {
37            project_id,
38            object_type,
39            object_id,
40            content,
41            author_user_id: None,
42        }
43    }
44}
45