Skip to content

chore(internal): fix examples #1457

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

Merged
merged 1 commit into from
Apr 8, 2025
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
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-472fe3036ea745365257fe870c0330917fb3153705c2826f49873cd631319b0a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-32de3bc513663c5fac922c49be41c222b6ee8c0b841d8966bcdfa489d441daa3.yml
openapi_spec_hash: ea86343b5e9858a74e85da8ab2c532f6
config_hash: ef19d36c307306f14f2e1cd5c834a151
config_hash: d6c61213488683418adb860a9ee1501b
2 changes: 1 addition & 1 deletion tests/api-resources/beta/threads/runs/runs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('resource runs', () => {
max_completion_tokens: 256,
max_prompt_tokens: 256,
metadata: { foo: 'string' },
model: 'gpt-4o',
model: 'string',
parallel_tool_calls: true,
reasoning_effort: 'low',
response_format: 'auto',
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/beta/threads/threads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('resource threads', () => {
max_completion_tokens: 256,
max_prompt_tokens: 256,
metadata: { foo: 'string' },
model: 'gpt-4o',
model: 'string',
parallel_tool_calls: true,
response_format: 'auto',
stream: false,
Expand Down
293 changes: 2 additions & 291 deletions tests/api-resources/evals/evals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,151 +11,7 @@ const client = new OpenAI({
describe('resource evals', () => {
test('create: only required params', async () => {
const responsePromise = client.evals.create({
data_source_config: {
item_schema: {
'0': 'bar',
'1': 'bar',
'2': 'bar',
'3': 'bar',
'4': 'bar',
'5': 'bar',
'6': 'bar',
'7': 'bar',
'8': 'bar',
'9': 'bar',
'10': 'bar',
'11': 'bar',
'12': 'bar',
'13': 'bar',
'14': 'bar',
'15': 'bar',
'16': 'bar',
'17': 'bar',
'18': 'bar',
'19': 'bar',
'20': 'bar',
'21': 'bar',
'22': 'bar',
'23': 'bar',
'24': 'bar',
'25': 'bar',
'26': 'bar',
'27': 'bar',
'28': 'bar',
'29': 'bar',
'30': 'bar',
'31': 'bar',
'32': 'bar',
'33': 'bar',
'34': 'bar',
'35': 'bar',
'36': 'bar',
'37': 'bar',
'38': 'bar',
'39': 'bar',
'40': 'bar',
'41': 'bar',
'42': 'bar',
'43': 'bar',
'44': 'bar',
'45': 'bar',
'46': 'bar',
'47': 'bar',
'48': 'bar',
'49': 'bar',
'50': 'bar',
'51': 'bar',
'52': 'bar',
'53': 'bar',
'54': 'bar',
'55': 'bar',
'56': 'bar',
'57': 'bar',
'58': 'bar',
'59': 'bar',
'60': 'bar',
'61': 'bar',
'62': 'bar',
'63': 'bar',
'64': 'bar',
'65': 'bar',
'66': 'bar',
'67': 'bar',
'68': 'bar',
'69': 'bar',
'70': 'bar',
'71': 'bar',
'72': 'bar',
'73': 'bar',
'74': 'bar',
'75': 'bar',
'76': 'bar',
'77': 'bar',
'78': 'bar',
'79': 'bar',
'80': 'bar',
'81': 'bar',
'82': 'bar',
'83': 'bar',
'84': 'bar',
'85': 'bar',
'86': 'bar',
'87': 'bar',
'88': 'bar',
'89': 'bar',
'90': 'bar',
'91': 'bar',
'92': 'bar',
'93': 'bar',
'94': 'bar',
'95': 'bar',
'96': 'bar',
'97': 'bar',
'98': 'bar',
'99': 'bar',
'100': 'bar',
'101': 'bar',
'102': 'bar',
'103': 'bar',
'104': 'bar',
'105': 'bar',
'106': 'bar',
'107': 'bar',
'108': 'bar',
'109': 'bar',
'110': 'bar',
'111': 'bar',
'112': 'bar',
'113': 'bar',
'114': 'bar',
'115': 'bar',
'116': 'bar',
'117': 'bar',
'118': 'bar',
'119': 'bar',
'120': 'bar',
'121': 'bar',
'122': 'bar',
'123': 'bar',
'124': 'bar',
'125': 'bar',
'126': 'bar',
'127': 'bar',
'128': 'bar',
'129': 'bar',
'130': 'bar',
'131': 'bar',
'132': 'bar',
'133': 'bar',
'134': 'bar',
'135': 'bar',
'136': 'bar',
'137': 'bar',
'138': 'bar',
'139': 'bar',
},
type: 'custom',
},
data_source_config: { item_schema: { foo: 'bar' }, type: 'custom' },
testing_criteria: [
{
input: [{ content: 'content', role: 'role' }],
Expand All @@ -178,152 +34,7 @@ describe('resource evals', () => {

test('create: required and optional params', async () => {
const response = await client.evals.create({
data_source_config: {
item_schema: {
'0': 'bar',
'1': 'bar',
'2': 'bar',
'3': 'bar',
'4': 'bar',
'5': 'bar',
'6': 'bar',
'7': 'bar',
'8': 'bar',
'9': 'bar',
'10': 'bar',
'11': 'bar',
'12': 'bar',
'13': 'bar',
'14': 'bar',
'15': 'bar',
'16': 'bar',
'17': 'bar',
'18': 'bar',
'19': 'bar',
'20': 'bar',
'21': 'bar',
'22': 'bar',
'23': 'bar',
'24': 'bar',
'25': 'bar',
'26': 'bar',
'27': 'bar',
'28': 'bar',
'29': 'bar',
'30': 'bar',
'31': 'bar',
'32': 'bar',
'33': 'bar',
'34': 'bar',
'35': 'bar',
'36': 'bar',
'37': 'bar',
'38': 'bar',
'39': 'bar',
'40': 'bar',
'41': 'bar',
'42': 'bar',
'43': 'bar',
'44': 'bar',
'45': 'bar',
'46': 'bar',
'47': 'bar',
'48': 'bar',
'49': 'bar',
'50': 'bar',
'51': 'bar',
'52': 'bar',
'53': 'bar',
'54': 'bar',
'55': 'bar',
'56': 'bar',
'57': 'bar',
'58': 'bar',
'59': 'bar',
'60': 'bar',
'61': 'bar',
'62': 'bar',
'63': 'bar',
'64': 'bar',
'65': 'bar',
'66': 'bar',
'67': 'bar',
'68': 'bar',
'69': 'bar',
'70': 'bar',
'71': 'bar',
'72': 'bar',
'73': 'bar',
'74': 'bar',
'75': 'bar',
'76': 'bar',
'77': 'bar',
'78': 'bar',
'79': 'bar',
'80': 'bar',
'81': 'bar',
'82': 'bar',
'83': 'bar',
'84': 'bar',
'85': 'bar',
'86': 'bar',
'87': 'bar',
'88': 'bar',
'89': 'bar',
'90': 'bar',
'91': 'bar',
'92': 'bar',
'93': 'bar',
'94': 'bar',
'95': 'bar',
'96': 'bar',
'97': 'bar',
'98': 'bar',
'99': 'bar',
'100': 'bar',
'101': 'bar',
'102': 'bar',
'103': 'bar',
'104': 'bar',
'105': 'bar',
'106': 'bar',
'107': 'bar',
'108': 'bar',
'109': 'bar',
'110': 'bar',
'111': 'bar',
'112': 'bar',
'113': 'bar',
'114': 'bar',
'115': 'bar',
'116': 'bar',
'117': 'bar',
'118': 'bar',
'119': 'bar',
'120': 'bar',
'121': 'bar',
'122': 'bar',
'123': 'bar',
'124': 'bar',
'125': 'bar',
'126': 'bar',
'127': 'bar',
'128': 'bar',
'129': 'bar',
'130': 'bar',
'131': 'bar',
'132': 'bar',
'133': 'bar',
'134': 'bar',
'135': 'bar',
'136': 'bar',
'137': 'bar',
'138': 'bar',
'139': 'bar',
},
type: 'custom',
include_sample_schema: true,
},
data_source_config: { item_schema: { foo: 'bar' }, type: 'custom', include_sample_schema: true },
testing_criteria: [
{
input: [{ content: 'content', role: 'role' }],
Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/images.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('resource images', () => {
test('createVariation: required and optional params', async () => {
const response = await client.images.createVariation({
image: await toFile(Buffer.from('# my file contents'), 'README.md'),
model: 'dall-e-2',
model: 'string',
n: 1,
response_format: 'url',
size: '1024x1024',
Expand All @@ -52,7 +52,7 @@ describe('resource images', () => {
image: await toFile(Buffer.from('# my file contents'), 'README.md'),
prompt: 'A cute baby sea otter wearing a beret',
mask: await toFile(Buffer.from('# my file contents'), 'README.md'),
model: 'dall-e-2',
model: 'string',
n: 1,
response_format: 'url',
size: '1024x1024',
Expand All @@ -74,7 +74,7 @@ describe('resource images', () => {
test('generate: required and optional params', async () => {
const response = await client.images.generate({
prompt: 'A cute baby sea otter',
model: 'dall-e-3',
model: 'string',
n: 1,
quality: 'standard',
response_format: 'url',
Expand Down
5 changes: 1 addition & 4 deletions tests/api-resources/moderations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ describe('resource moderations', () => {
});

test('create: required and optional params', async () => {
const response = await client.moderations.create({
input: 'I want to kill them.',
model: 'omni-moderation-2024-09-26',
});
const response = await client.moderations.create({ input: 'I want to kill them.', model: 'string' });
});
});