snowcell
Version:
Official Snowcell Node.js/TypeScript SDK
20 lines • 590 B
JavaScript
export class Completions {
_client;
constructor(_client) {
this._client = _client;
}
async create(params) {
const { model, prompt, max_tokens = 512, temperature = 0.7, stream = false, ...extra } = params;
const body = JSON.stringify({
model,
prompt,
max_tokens,
temperature,
stream,
...extra,
});
const res = await this._client['_inference']('POST', '/v1/completions', { body });
return (await res.json());
}
}
//# sourceMappingURL=completions.js.map