Skip to content

Commit 7f7f5fa

Browse files
committed
fix(llmobs): normalize dataset mutation responses
1 parent 3420490 commit 7f7f5fa

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/dd-trace/src/llmobs/experiments/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class ExperimentsClient {
197197
const resources = Array.isArray(response?.records)
198198
? response.records
199199
: (Array.isArray(response?.data) ? response.data : [])
200-
return resources.map(datasetRecordFromResource)
200+
return datasetMutationResultFromResources(resources)
201201
}
202202

203203
async batchUpdateDatasetRecords (projectId, datasetId, attributes) {

packages/dd-trace/src/llmobs/experiments/noop.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class NoopDataset {
1717
input: record.inputData,
1818
expectedOutput: record.expectedOutput ?? null,
1919
metadata: record.metadata ?? {},
20-
tags: record.tags ?? [],
20+
...(record.tags === undefined ? {} : { tags: record.tags }),
2121
}))
2222
}
2323

@@ -27,7 +27,7 @@ class NoopDataset {
2727
input,
2828
expectedOutput: expectedOutput ?? null,
2929
metadata: metadata ?? {},
30-
tags: tags ?? [],
30+
...(tags === undefined ? {} : { tags }),
3131
})
3232
return this
3333
}

0 commit comments

Comments
 (0)