Skip to content
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
13 changes: 9 additions & 4 deletions .github/scripts/sdk-live-test/src/scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ function mergeParams(model: CatalogueModel): Record<string, unknown> {
return merged;
}

/** The SDK appends the request path to `{openai_endpoint}/openai/v1` for Foundry, so `/v1` would be doubled. */
function responsesPath(model: CatalogueModel): string {
return model.provider === 'microsoft-foundry' ? '/responses' : '/v1/responses';
}

/** Cheap output cap; honor removeParams (gpt-4.1* → max_completion_tokens). */
function withCap(model: CatalogueModel, body: Record<string, unknown>): Record<string, unknown> {
const removed = new Set(model.removeParams ?? []);
Expand Down Expand Up @@ -637,7 +642,7 @@ function planOneMode(model: CatalogueModel, mode: string): Scenario[] {
out.push({
id: label('responses/baseline', stream),
endpoint: 'createModelResponse',
path: '/v1/responses',
path: responsesPath(model),
body: {
model: modelId,
input: 'Reply with the single word: ok',
Expand All @@ -656,7 +661,7 @@ function planOneMode(model: CatalogueModel, mode: string): Scenario[] {
out.push({
id: label(kind, stream),
endpoint: 'createModelResponse',
path: '/v1/responses',
path: responsesPath(model),
body: {
...responsesModalityBody(chatFeatureBody(model, feature)),
...(stream ? { stream: true } : {}),
Expand All @@ -671,7 +676,7 @@ function planOneMode(model: CatalogueModel, mode: string): Scenario[] {
out.push({
id: label('responses/params', stream),
endpoint: 'createModelResponse',
path: '/v1/responses',
path: responsesPath(model),
body: {
...responsesModalityBody(
withCap(model, {
Expand All @@ -686,7 +691,7 @@ function planOneMode(model: CatalogueModel, mode: string): Scenario[] {
}
}
}
pushModalitySmokes(out, model, 'createModelResponse', '/v1/responses', responsesModalityBody);
pushModalitySmokes(out, model, 'createModelResponse', responsesPath(model), responsesModalityBody);
return out;

case 'embedding':
Expand Down
9 changes: 9 additions & 0 deletions .github/scripts/sdk-live-test/test/changed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ describe('planScenarios', () => {
assert.ok(ids.includes('chat/params/stream'));
});

it('foundry responses use /responses, others /v1/responses', () => {
const paths = (provider: string) =>
planScenarios({ provider, model: 'gpt', mode: 'responses' })
.filter((s) => s.id.startsWith('responses/baseline'))
.map((s) => s.path);
assert.deepEqual(paths('microsoft-foundry'), ['/responses', '/responses']);
assert.deepEqual(paths('openai'), ['/v1/responses', '/v1/responses']);
});

it('caps with max_completion_tokens when max_tokens removed', () => {
const body = planScenarios({
provider: 'openai',
Expand Down
Loading