Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e6d97fd
refactor(llmobs): track dataset changes locally
mehulsonowal Aug 13, 2026
28e19a2
fix(llmobs): address dataset state review feedback
mehulsonowal Aug 13, 2026
d9dd5db
fix(llmobs): normalize dataset update payloads
mehulsonowal Aug 13, 2026
0c8b3f6
test(llmobs): record dataset batch updates
mehulsonowal Aug 13, 2026
d4db55e
fix(llmobs): correct dataset batch cassettes
mehulsonowal Aug 13, 2026
6eb529a
fix(llmobs): preserve null dataset outputs
mehulsonowal Aug 13, 2026
a8f37e1
refactor(llmobs): remove unused dataset record ids
mehulsonowal Aug 13, 2026
1c862eb
test(llmobs): cover dataset batch endpoint
mehulsonowal Aug 13, 2026
ecfec67
test(llmobs): record batch endpoint interactions
mehulsonowal Aug 13, 2026
f0ad72d
test(llmobs): record batch test project cassette
mehulsonowal Aug 13, 2026
0d84bc3
test(llmobs): replace manually created batch cassettes
mehulsonowal Aug 13, 2026
876441b
test(llmobs): refresh facade VCR fixtures
mehulsonowal Aug 13, 2026
780f11f
test(llmobs): refresh client VCR fixtures
mehulsonowal Aug 13, 2026
438da86
test(llmobs): isolate client VCR project
mehulsonowal Aug 13, 2026
915e158
test(llmobs): fix experiment test lint
mehulsonowal Aug 13, 2026
9cccc23
test(llmobs): improve experiments coverage
mehulsonowal Aug 13, 2026
66f7f68
feat(llmobs): add dataset record tags
mehulsonowal Aug 13, 2026
44b98e8
test(llmobs): update dataset tag expectations
mehulsonowal Aug 13, 2026
da060fa
test(llmobs): cover dataset tag filters
mehulsonowal Aug 13, 2026
6a7f58f
fix(llmobs): normalize dataset mutation responses
mehulsonowal Aug 13, 2026
f1e0c3b
fix(llmobs): preserve dataset update fields
mehulsonowal Aug 13, 2026
6952df2
Merge origin/master into dataset record tags v2
mehulsonowal Aug 14, 2026
f916375
Merge latest master into dataset record tags v2
mehulsonowal Aug 14, 2026
b30f9d7
fix(llmobs): avoid stale version on latest dataset pulls
mehulsonowal Aug 14, 2026
71c9b0d
fix(llmobs): use mutation response dataset versions
mehulsonowal Aug 14, 2026
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
23 changes: 20 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3795,7 +3795,8 @@ declare namespace tracer {
id?: string,
inputData: JSONType,
expectedOutput?: JSONType,
metadata?: Record<string, JSONType>
metadata?: Record<string, JSONType>,
tags?: string[]
}>
}

Expand Down Expand Up @@ -3828,6 +3829,8 @@ declare namespace tracer {
expectedRecordCount?: number
/** Maximum total time to wait, in ms. Default 30000. */
maxWaitMs?: number
/** Filter records by these tags. */
tags?: string[]
}

interface ExperimentResultRow {
Expand Down Expand Up @@ -3945,7 +3948,12 @@ declare namespace tracer {
}

interface Dataset {
addRecord (input: JSONType, expectedOutput?: JSONType, metadata?: Record<string, JSONType>): Dataset
addRecord (
input: JSONType,
expectedOutput?: JSONType,
metadata?: Record<string, JSONType>,
tags?: string[]
): Dataset
/** Update fields on an existing dataset record. */
update (index: number, fields: {
input?: JSONType
Expand All @@ -3954,6 +3962,12 @@ declare namespace tracer {
}): Dataset
/** Delete an existing dataset record. */
delete (index: number): Dataset
/** Add tags to a dataset record. */
addTags (index: number, tags: string[]): Dataset
/** Remove tags from a dataset record. */
removeTags (index: number, tags: string[]): Dataset
/** Replace all tags on a dataset record. */
replaceTags (index: number, tags: string[]): Dataset
/** Creates the dataset remotely if needed and pushes any unpushed records. */
push (): Promise<DatasetPushResult>
name (): string
Expand All @@ -3966,8 +3980,11 @@ declare namespace tracer {
id: string | null,
input: JSONType,
expectedOutput: JSONType,
metadata: Record<string, JSONType>
metadata: Record<string, JSONType>,
tags: string[]
}>
/** Return the tags used to filter this dataset. */
filterTags (): string[]
/** Dashboard URL for the dataset, or null until pushed. */
url (): string | null
}
Expand Down
23 changes: 20 additions & 3 deletions index.d.v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3992,7 +3992,8 @@ declare namespace tracer {
id?: string,
inputData: JSONType,
expectedOutput?: JSONType,
metadata?: Record<string, JSONType>
metadata?: Record<string, JSONType>,
tags?: string[]
}>
}

Expand Down Expand Up @@ -4025,6 +4026,8 @@ declare namespace tracer {
expectedRecordCount?: number
/** Maximum total time to wait, in ms. Default 30000. */
maxWaitMs?: number
/** Filter records by these tags. */
tags?: string[]
}

interface ExperimentResultRow {
Expand Down Expand Up @@ -4142,7 +4145,12 @@ declare namespace tracer {
}

interface Dataset {
addRecord (input: JSONType, expectedOutput?: JSONType, metadata?: Record<string, JSONType>): Dataset
addRecord (
input: JSONType,
expectedOutput?: JSONType,
metadata?: Record<string, JSONType>,
tags?: string[]
): Dataset
/** Update fields on an existing dataset record. */
update (index: number, fields: {
input?: JSONType
Expand All @@ -4151,6 +4159,12 @@ declare namespace tracer {
}): Dataset
/** Delete an existing dataset record. */
delete (index: number): Dataset
/** Add tags to a dataset record. */
addTags (index: number, tags: string[]): Dataset
/** Remove tags from a dataset record. */
removeTags (index: number, tags: string[]): Dataset
/** Replace all tags on a dataset record. */
replaceTags (index: number, tags: string[]): Dataset
/** Creates the dataset remotely if needed and pushes any unpushed records. */
push (): Promise<DatasetPushResult>
name (): string
Expand All @@ -4163,8 +4177,11 @@ declare namespace tracer {
id: string | null,
input: JSONType,
expectedOutput: JSONType,
metadata: Record<string, JSONType>
metadata: Record<string, JSONType>,
tags: string[]
}>
/** Return the tags used to filter this dataset. */
filterTags (): string[]
/** Dashboard URL for the dataset, or null until pushed. */
url (): string | null
}
Expand Down
8 changes: 6 additions & 2 deletions packages/dd-trace/src/llmobs/experiments/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ function datasetRecordFromResource (resource) {
attrs.input ?? null,
attrs.expected_output ?? null,
attrs.metadata ?? {},
id
id,
attrs.tags ?? []
)
}

Expand Down Expand Up @@ -195,7 +196,7 @@ class ExperimentsClient {
const resources = Array.isArray(response?.records)
? response.records
: (Array.isArray(response?.data) ? response.data : [])
return resources.map(datasetRecordFromResource)
return datasetMutationResultFromResources(resources)
}

async batchUpdateDatasetRecords (projectId, datasetId, attributes) {
Expand Down Expand Up @@ -226,6 +227,9 @@ class ExperimentsClient {
const query = new URLSearchParams()
if (options.cursor) query.set('page[cursor]', options.cursor)
if (options.version !== undefined && options.version !== null) query.set('filter[version]', String(options.version))
if (Array.isArray(options.tags)) {
for (const tag of options.tags) query.append('filter[tags]', tag)
}
const response = await this.request(
'GET',
`${API_BASE_PATH}/${projectId}/datasets/${datasetId}/records?${query.toString()}`
Expand Down
Loading
Loading