From cae4c97a29221fd46aa798d93c0ed10b6e94cb7d Mon Sep 17 00:00:00 2001 From: TensorNull Date: Fri, 31 Jul 2026 17:00:44 +0800 Subject: [PATCH] fix: update examples to gpt-5.6-sol --- .github/workflows/live-smoke.yml | 2 +- .github/workflows/publish.yml | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 8 ++++---- examples/README.md | 2 +- examples/commonjs.cjs | 2 +- examples/esm.mjs | 4 ++-- scripts/fixtures/mock-example-fetch.cjs | 16 ++++++++-------- scripts/live-smoke.mjs | 4 +++- scripts/release-workflow-validation.mjs | 4 ++-- scripts/test-examples.mjs | 2 +- scripts/test-live-smoke-contract.mjs | 19 ++++++++++++++++--- 12 files changed, 42 insertions(+), 27 deletions(-) diff --git a/.github/workflows/live-smoke.yml b/.github/workflows/live-smoke.yml index 296ecb7..fe24767 100644 --- a/.github/workflows/live-smoke.yml +++ b/.github/workflows/live-smoke.yml @@ -41,7 +41,7 @@ jobs: env: COMETAPI_KEY: ${{ secrets.COMETAPI_KEY }} COMETAPI_LIVE_SMOKE: "1" - COMETAPI_SMOKE_MODEL: ${{ vars.COMETAPI_SMOKE_MODEL || 'gpt-5.4' }} + COMETAPI_SMOKE_MODEL: ${{ vars.COMETAPI_SMOKE_MODEL || 'gpt-5.6-sol' }} COMETAPI_LIVE_REQUEST_LIMIT: "3" COMETAPI_LIVE_MAX_OUTPUT_TOKENS: "16" COMETAPI_LIVE_REQUEST_TIMEOUT_MS: "60000" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e3f0239..90dd051 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -705,7 +705,7 @@ jobs: env: COMETAPI_KEY: ${{ secrets.COMETAPI_KEY }} COMETAPI_LIVE_SMOKE: "1" - COMETAPI_SMOKE_MODEL: ${{ vars.COMETAPI_SMOKE_MODEL || 'gpt-5.4' }} + COMETAPI_SMOKE_MODEL: ${{ vars.COMETAPI_SMOKE_MODEL || 'gpt-5.6-sol' }} COMETAPI_LIVE_REQUEST_LIMIT: "3" COMETAPI_LIVE_MAX_OUTPUT_TOKENS: "16" COMETAPI_LIVE_REQUEST_TIMEOUT_MS: "60000" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2184ba..8c67671 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,8 +72,8 @@ and CommonJS fixtures. All repository documentation is written in English. Public behavior changes must update the README, compatibility matrix, examples, roadmap when milestone -scope changes, and changelog. Examples use current model IDs such as `gpt-5.4` -and must not contain real keys. +scope changes, and changelog. Examples use current model IDs such as +`gpt-5.6-sol` and must not contain real keys. Keep this repository self-contained. Do not add commands or links that require files outside the repository root, a sibling SDK, or a private checkout. diff --git a/README.md b/README.md index 5cb0919..9733bc5 100644 --- a/README.md +++ b/README.md @@ -103,14 +103,14 @@ import { CometAPI } from "cometapi"; const client = new CometAPI(); const response = await client.responses.create({ - model: "gpt-5.4", + model: "gpt-5.6-sol", input: "Explain why the sky is blue in one sentence.", }); console.log(response.output_text); const stream = await client.chat.completions.create({ - model: "gpt-5.4", + model: "gpt-5.6-sol", messages: [{ role: "user", content: "Write one sentence about comets." }], stream: true, }); @@ -130,7 +130,7 @@ const client = new CometAPI(); async function main() { const completion = await client.chat.completions.create({ - model: "gpt-5.4", + model: "gpt-5.6-sol", messages: [{ role: "user", content: "Reply with one short greeting." }], }); console.log(completion.choices[0]?.message?.content ?? ""); @@ -168,7 +168,7 @@ const client = new CometAPI({ const response = await client.chat.completions.create( { - model: "gpt-5.4", + model: "gpt-5.6-sol", messages: [{ role: "user", content: "Reply with OK." }], }, { timeout: 5_000 }, diff --git a/examples/README.md b/examples/README.md index b868495..86471e5 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,7 +1,7 @@ # Examples These examples exercise only the supported 0.1 surface and use the current -default example model, `gpt-5.4`. +default example model, `gpt-5.6-sol`. - `esm.mjs` verifies ESM import, Responses, and streaming Chat Completions. - `commonjs.cjs` verifies CommonJS loading, non-streaming Chat Completions, and diff --git a/examples/commonjs.cjs b/examples/commonjs.cjs index d2a8d8f..41b1e40 100644 --- a/examples/commonjs.cjs +++ b/examples/commonjs.cjs @@ -4,7 +4,7 @@ const client = new CometAPI(); async function main() { const completion = await client.chat.completions.create({ - model: "gpt-5.4", + model: "gpt-5.6-sol", messages: [{ role: "user", content: "Reply with one short greeting." }], }); console.log(completion.choices[0]?.message?.content ?? ""); diff --git a/examples/esm.mjs b/examples/esm.mjs index 302bf53..b97a05a 100644 --- a/examples/esm.mjs +++ b/examples/esm.mjs @@ -3,14 +3,14 @@ import { CometAPI } from "cometapi"; const client = new CometAPI(); const response = await client.responses.create({ - model: "gpt-5.4", + model: "gpt-5.6-sol", input: "Explain why the sky is blue in one sentence.", }); console.log(response.output_text); const stream = await client.chat.completions.create({ - model: "gpt-5.4", + model: "gpt-5.6-sol", messages: [{ role: "user", content: "Write one sentence about comets." }], stream: true, }); diff --git a/scripts/fixtures/mock-example-fetch.cjs b/scripts/fixtures/mock-example-fetch.cjs index 3880204..4abf547 100644 --- a/scripts/fixtures/mock-example-fetch.cjs +++ b/scripts/fixtures/mock-example-fetch.cjs @@ -37,7 +37,7 @@ const expectations = method: "POST", path: "/v1/responses", body: { - model: "gpt-5.4", + model: "gpt-5.6-sol", input: "Explain why the sky is blue in one sentence.", }, response: () => @@ -47,7 +47,7 @@ const expectations = object: "response", created_at: 1, status: "completed", - model: "gpt-5.4", + model: "gpt-5.6-sol", output: [ { id: "msg_example", @@ -75,7 +75,7 @@ const expectations = method: "POST", path: "/v1/chat/completions", body: { - model: "gpt-5.4", + model: "gpt-5.6-sol", messages: [ { role: "user", content: "Write one sentence about comets." }, ], @@ -84,9 +84,9 @@ const expectations = response: () => new Response( [ - 'data: {"id":"chat_example","object":"chat.completion.chunk","created":1,"model":"gpt-5.4","choices":[{"index":0,"delta":{"content":"Comets "},"finish_reason":null}]}', + 'data: {"id":"chat_example","object":"chat.completion.chunk","created":1,"model":"gpt-5.6-sol","choices":[{"index":0,"delta":{"content":"Comets "},"finish_reason":null}]}', "", - 'data: {"id":"chat_example","object":"chat.completion.chunk","created":1,"model":"gpt-5.4","choices":[{"index":0,"delta":{"content":"shine."},"finish_reason":null}]}', + 'data: {"id":"chat_example","object":"chat.completion.chunk","created":1,"model":"gpt-5.6-sol","choices":[{"index":0,"delta":{"content":"shine."},"finish_reason":null}]}', "", "data: [DONE]", "", @@ -100,7 +100,7 @@ const expectations = method: "POST", path: "/v1/chat/completions", body: { - model: "gpt-5.4", + model: "gpt-5.6-sol", messages: [ { role: "user", content: "Reply with one short greeting." }, ], @@ -111,7 +111,7 @@ const expectations = id: "chat_example", object: "chat.completion", created: 1, - model: "gpt-5.4", + model: "gpt-5.6-sol", choices: [ { index: 0, @@ -137,7 +137,7 @@ const expectations = object: "list", data: [ { - id: "gpt-5.4", + id: "gpt-5.6-sol", object: "model", created: 1, owned_by: "cometapi", diff --git a/scripts/live-smoke.mjs b/scripts/live-smoke.mjs index 68a9ddb..e67fd84 100644 --- a/scripts/live-smoke.mjs +++ b/scripts/live-smoke.mjs @@ -26,7 +26,7 @@ const REQUEST_TIMEOUT_MS = readBudget( 60_000, ); const concurrency = readBudget("COMETAPI_LIVE_CONCURRENCY", 1); -const model = process.env.COMETAPI_SMOKE_MODEL ?? "gpt-5.4"; +const model = process.env.COMETAPI_SMOKE_MODEL ?? "gpt-5.6-sol"; if ( process.env.COMETAPI_BASE_URL !== undefined && @@ -89,6 +89,7 @@ const chat = await client.chat.completions.create({ max_completion_tokens: OUTPUT_TOKEN_LIMIT, messages: [{ content: "Reply with OK.", role: "user" }], model, + reasoning_effort: "none", }); assert.ok(chat.id, "Chat Completions returned no response ID"); const chatChoice = chat.choices[0]; @@ -107,6 +108,7 @@ const stream = await client.responses.create({ input: "Reply with OK.", max_output_tokens: OUTPUT_TOKEN_LIMIT, model, + reasoning: { effort: "none" }, stream: true, }); let eventCount = 0; diff --git a/scripts/release-workflow-validation.mjs b/scripts/release-workflow-validation.mjs index 984ef34..826a47f 100644 --- a/scripts/release-workflow-validation.mjs +++ b/scripts/release-workflow-validation.mjs @@ -18,7 +18,7 @@ const RELEASE_WORKFLOW_STEP = "Run Release Please"; const PUBLISH_OPERATION = "release"; const NPM_TAG_POLICY_ID = 55718965; const PUBLISH_WORKFLOW_CONTRACT_SHA256 = - "71e517276bc595ca7cb378997f5d9a007d0c2b8da98019c5dc870f74e0621745"; + "081af3a47c0bef1ff38a77cf038ab3c66b8c14ea2b524c42bc4f2c21e41f9f79"; const PUBLISH_HANDOFF_IF = "vars.RELEASE_PLEASE_ENABLED == 'true' && github.event_name == 'workflow_run' && github.run_attempt == 1 && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main'"; const PUBLISH_RESULT_IF = "steps.result.outputs.has-result == 'true'"; @@ -569,7 +569,7 @@ fi JSON.stringify({ COMETAPI_KEY: "${{ secrets.COMETAPI_KEY }}", COMETAPI_LIVE_SMOKE: "1", - COMETAPI_SMOKE_MODEL: "${{ vars.COMETAPI_SMOKE_MODEL || 'gpt-5.4' }}", + COMETAPI_SMOKE_MODEL: "${{ vars.COMETAPI_SMOKE_MODEL || 'gpt-5.6-sol' }}", COMETAPI_LIVE_REQUEST_LIMIT: "3", COMETAPI_LIVE_MAX_OUTPUT_TOKENS: "16", COMETAPI_LIVE_REQUEST_TIMEOUT_MS: "60000", diff --git a/scripts/test-examples.mjs b/scripts/test-examples.mjs index 14dc69c..dd3cd86 100644 --- a/scripts/test-examples.mjs +++ b/scripts/test-examples.mjs @@ -99,7 +99,7 @@ try { [ "commonjs", "commonjs.cjs", - "Hello from CometAPI!\ngpt-5.4\nclaude-sonnet-4-6\n", + "Hello from CometAPI!\ngpt-5.6-sol\nclaude-sonnet-4-6\n", ], ]) { const output = run( diff --git a/scripts/test-live-smoke-contract.mjs b/scripts/test-live-smoke-contract.mjs index 2d0020b..012ff03 100644 --- a/scripts/test-live-smoke-contract.mjs +++ b/scripts/test-live-smoke-contract.mjs @@ -3,6 +3,7 @@ import { spawnSync } from "node:child_process"; const script = new globalThis.URL("./live-smoke.mjs", import.meta.url); const LIVE_BASE_URL = "https://api.cometapi.com/v1"; +const DEFAULT_MODEL = "gpt-5.6-sol"; const FULL_REQUEST_SEQUENCE = [ `${LIVE_BASE_URL}/models`, `${LIVE_BASE_URL}/chat/completions`, @@ -18,6 +19,7 @@ const environmentNames = [ "COMETAPI_LIVE_REQUEST_LIMIT", "COMETAPI_LIVE_REQUEST_TIMEOUT_MS", "COMETAPI_LIVE_SMOKE", + "COMETAPI_SMOKE_MODEL", ]; const originalEnvironment = new Map( environmentNames.map((name) => [name, process.env[name]]), @@ -44,7 +46,7 @@ function completedResponse() { return { created_at: 1, id: "resp_live_contract", - model: "gpt-5.4", + model: DEFAULT_MODEL, object: "response", output: [], parallel_tool_calls: true, @@ -65,7 +67,7 @@ function createMockFetch(scenario, requestURLs = []) { data: [ { created: 1, - id: "gpt-5.4", + id: DEFAULT_MODEL, object: "model", owned_by: "cometapi", }, @@ -75,6 +77,9 @@ function createMockFetch(scenario, requestURLs = []) { } if (request.url.endsWith("/chat/completions")) { + const body = await request.clone().json(); + assert.equal(body.model, DEFAULT_MODEL); + assert.equal(body.reasoning_effort, "none"); return json({ choices: scenario === "empty-chat" @@ -88,12 +93,15 @@ function createMockFetch(scenario, requestURLs = []) { ], created: 1, id: "chatcmpl_live_contract", - model: "gpt-5.4", + model: DEFAULT_MODEL, object: "chat.completion", }); } assert.ok(request.url.endsWith("/responses")); + const body = await request.clone().json(); + assert.equal(body.model, DEFAULT_MODEL); + assert.deepEqual(body.reasoning, { effort: "none" }); if (scenario === "failed-response") { return sse([ { @@ -179,6 +187,7 @@ async function runSuccessfulScenario() { function runFailingScenario(scenario, environment = {}) { const childProgram = [ 'import assert from "node:assert/strict";', + `const DEFAULT_MODEL = ${JSON.stringify(DEFAULT_MODEL)};`, `const requestURLs = [];`, json.toString(), sse.toString(), @@ -204,6 +213,9 @@ function runFailingScenario(scenario, environment = {}) { if (!("COMETAPI_BASE_URL" in environment)) { Reflect.deleteProperty(childEnvironment, "COMETAPI_BASE_URL"); } + if (!("COMETAPI_SMOKE_MODEL" in environment)) { + Reflect.deleteProperty(childEnvironment, "COMETAPI_SMOKE_MODEL"); + } return spawnSync( process.execPath, @@ -233,6 +245,7 @@ try { process.env.COMETAPI_LIVE_REQUEST_TIMEOUT_MS = "60000"; process.env.COMETAPI_LIVE_CONCURRENCY = "1"; delete process.env.COMETAPI_BASE_URL; + delete process.env.COMETAPI_SMOKE_MODEL; await runSuccessfulScenario(); assertFailingScenario({