-
Notifications
You must be signed in to change notification settings - Fork 5
/
synthetic-data-generation.ts
62 lines (53 loc) · 1.91 KB
/
synthetic-data-generation.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
import * as SyntheticDataGenerationAPI from './synthetic-data-generation';
import * as RewardScoringAPI from './reward-scoring';
import * as Shared from './shared';
export class SyntheticDataGenerationResource extends APIResource {
generate(
params: SyntheticDataGenerationGenerateParams,
options?: Core.RequestOptions,
): Core.APIPromise<SyntheticDataGeneration> {
const { 'X-LlamaStack-ProviderData': xLlamaStackProviderData, ...body } = params;
return this._client.post('/synthetic_data_generation/generate', {
body,
...options,
headers: {
...(xLlamaStackProviderData != null ?
{ 'X-LlamaStack-ProviderData': xLlamaStackProviderData }
: undefined),
...options?.headers,
},
});
}
}
export interface SyntheticDataGeneration {
synthetic_data: Array<RewardScoringAPI.ScoredDialogGenerations>;
statistics?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
}
export interface SyntheticDataGenerationGenerateParams {
/**
* Body param:
*/
dialogs: Array<
Shared.UserMessage | Shared.SystemMessage | Shared.ToolResponseMessage | Shared.CompletionMessage
>;
/**
* Body param:
*/
filtering_function: 'none' | 'random' | 'top_k' | 'top_p' | 'top_k_top_p' | 'sigmoid';
/**
* Body param:
*/
model?: string;
/**
* Header param: JSON-encoded provider data which will be made available to the
* adapter servicing the API
*/
'X-LlamaStack-ProviderData'?: string;
}
export namespace SyntheticDataGenerationResource {
export import SyntheticDataGeneration = SyntheticDataGenerationAPI.SyntheticDataGeneration;
export import SyntheticDataGenerationGenerateParams = SyntheticDataGenerationAPI.SyntheticDataGenerationGenerateParams;
}