Skip to main content

Official SDKs

Gnaww provides official TypeScript / JavaScript, Python and PHP SDKs generated from the same reviewed gnaww-developer-v0.1 OpenAPI contract. The SDKs are transport and presentation layers. They do not contain a second implementation of Gnaww interpretation, Job decomposition, Recipe identity or SpecMatch.

The reviewed contract now carries the job-centric gnaww.interpretation_result v0.2 response for POST /v1/interpret and its v0.2 continuation request. One input can therefore return one or many Jobs through the same operation.

TypeScript / JavaScript​

npm install @jawwws/gnaww
import { GnawwClient } from '@jawwws/gnaww';

const gnaww = new GnawwClient({
apiKey: process.env.GNAWW_API_KEY!,
workspaceId: process.env.GNAWW_WORKSPACE_ID,
});

const result = await gnaww.consume(
'500 A5 flyers and 50 embroidered navy T-shirts',
);

console.log(result.intent.kind);
for (const job of result.jobs) {
console.log(job.jobId, job.status, job.productFamily, job.gjs);
}

Continuation answers use the public questionId returned by Gnaww. The SDK does not derive question scope itself.

Python​

pip install gnaww-sdk
import os
from gnaww_sdk import GnawwClient

with GnawwClient(
api_key=os.environ["GNAWW_API_KEY"],
workspace_id=os.environ.get("GNAWW_WORKSPACE_ID"),
) as gnaww:
result = gnaww.consume(
"500 A5 flyers and 50 embroidered navy T-shirts"
)

print(result.intent.kind)
for job in result.jobs:
print(job.job_id, job.status, job.product_family, job.gjs)

PHP​

composer require jawwws/gnaww-sdk
<?php

use Jawwws\Gnaww\GnawwClient;

$gnaww = new GnawwClient(
getenv('GNAWW_API_KEY'),
'https://api.gnaww.io',
getenv('GNAWW_WORKSPACE_ID') ?: null,
);

$result = $gnaww->consume(
'500 A5 flyers and 50 embroidered navy T-shirts'
);

foreach ($result->getJobs() as $job) {
printf("%s %s\n", $job->getJobId(), $job->getStatus());
}

Version state​

The current public SDK release line is 0.2.0 for TypeScript / JavaScript, Python and PHP. As part of issue #477, all three packages were published through their approved release paths and verified by clean external registry installs against the job-centric gnaww.interpretation_result v0.2 model. The reviewed developer contract remains gnaww-developer-v0.1; package SemVer is an independent version layer.

The packages use the MIT licence. A 1.0.0 release will represent a deliberate stability commitment, not a cosmetic version change.

The richer interpretation result does not change the ownership boundary. SDKs expose the typed server result and public question identities; they do not split intent into Jobs, infer question scope, canonicalise demand or perform SpecMatch locally.