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
2 changes: 1 addition & 1 deletion .github/workflows/live-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand All @@ -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 ?? "");
Expand Down Expand Up @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/commonjs.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "");
Expand Down
4 changes: 2 additions & 2 deletions examples/esm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
16 changes: 8 additions & 8 deletions scripts/fixtures/mock-example-fetch.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: () =>
Expand All @@ -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",
Expand Down Expand Up @@ -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." },
],
Expand All @@ -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]",
"",
Expand All @@ -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." },
],
Expand All @@ -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,
Expand All @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion scripts/live-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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];
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions scripts/release-workflow-validation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'";
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-examples.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
19 changes: 16 additions & 3 deletions scripts/test-live-smoke-contract.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -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]]),
Expand All @@ -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,
Expand All @@ -65,7 +67,7 @@ function createMockFetch(scenario, requestURLs = []) {
data: [
{
created: 1,
id: "gpt-5.4",
id: DEFAULT_MODEL,
object: "model",
owned_by: "cometapi",
},
Expand All @@ -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"
Expand All @@ -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([
{
Expand Down Expand Up @@ -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(),
Expand All @@ -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,
Expand Down Expand Up @@ -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({
Expand Down