Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api): rename resources to match new api #322

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased
- Round trip `field_id`
- Add `ixp` dataset flag
- rename label def description to instructions

# v0.33.1
- Fix selection index issue on custom label trend reports
Expand Down
1 change: 1 addition & 0 deletions api/src/resources/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub enum DatasetFlag {
ExternalMoonLlm,
Qos,
ZeroShotLabels,
Ixp,
}

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
Expand Down
4 changes: 2 additions & 2 deletions api/src/resources/label_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct LabelDef {
pub name: Name,

#[serde(default)]
pub description: String,
pub instructions: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub external_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand All @@ -28,7 +28,7 @@ pub struct NewLabelDef {
pub name: Name,

#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
pub instructions: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub external_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand Down
10 changes: 5 additions & 5 deletions cli/tests/test_datasets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn test_create_update_dataset_custom() {
},
{
"name": "foo",
"description": "Long label description",
"instructions": "Long label description",
"external_id": "ext id",
"title": "Title Me",
"pretrained": {
Expand Down Expand Up @@ -224,15 +224,15 @@ fn test_create_update_dataset_custom() {
label_defs: vec![
LabelDef {
name: LabelName("bar".to_owned()),
description: "".to_owned(),
instructions: "".to_owned(),
external_id: None,
pretrained: None,
title: "".to_owned(),
moon_form: None,
},
LabelDef {
name: LabelName("foo".to_owned()),
description: "Long label description".to_owned(),
instructions: "Long label description".to_owned(),
external_id: Some("ext id".to_owned()),
pretrained: Some(LabelDefPretrained {
id: LabelDefPretrainedId("0000000000000001".to_owned()),
Expand All @@ -250,15 +250,15 @@ fn test_create_update_dataset_custom() {
label_defs: vec![
LabelDef {
name: LabelName("bar".to_owned()),
description: "".to_owned(),
instructions: "".to_owned(),
external_id: None,
pretrained: None,
title: "".to_owned(),
moon_form: None,
},
LabelDef {
name: LabelName("foo".to_owned()),
description: "Long label description".to_owned(),
instructions: "Long label description".to_owned(),
external_id: Some("ext id".to_owned()),
pretrained: Some(LabelDefPretrained {
id: LabelDefPretrainedId("0000000000000001".to_owned()),
Expand Down
Loading