@@ -149,7 +149,9 @@ const client = new PromptFoundry({
149149});
150150
151151async function main() {
152- const modelParameters: PromptFoundry .ModelParameters = await client .prompts .getParameters (' 1212121' );
152+ const completionCreateResponse: PromptFoundry .CompletionCreateResponse = await client .completion .create (
153+ ' 1212121' ,
154+ );
153155}
154156
155157main ();
@@ -166,7 +168,7 @@ a subclass of `APIError` will be thrown:
166168<!-- prettier-ignore -->
167169``` ts
168170async function main() {
169- const modelParameters = await client .prompts . getParameters (' 1212121' ).catch (async (err ) => {
171+ const completionCreateResponse = await client .completion . create (' 1212121' ).catch (async (err ) => {
170172 if (err instanceof PromptFoundry .APIError ) {
171173 console .log (err .status ); // 400
172174 console .log (err .name ); // BadRequestError
@@ -209,7 +211,7 @@ const client = new PromptFoundry({
209211});
210212
211213// Or, configure per-request:
212- await client .prompts . getParameters (' 1212121' , {
214+ await client .completion . create (' 1212121' , {
213215 maxRetries: 5 ,
214216});
215217```
@@ -226,7 +228,7 @@ const client = new PromptFoundry({
226228});
227229
228230// Override per-request:
229- await client .prompts . getParameters (' 1212121' , {
231+ await client .completion . create (' 1212121' , {
230232 timeout: 5 * 1000 ,
231233});
232234```
@@ -247,13 +249,15 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
247249``` ts
248250const client = new PromptFoundry ();
249251
250- const response = await client .prompts . getParameters (' 1212121' ).asResponse ();
252+ const response = await client .completion . create (' 1212121' ).asResponse ();
251253console .log (response .headers .get (' X-My-Header' ));
252254console .log (response .statusText ); // access the underlying Response object
253255
254- const { data : modelParameters, response : raw } = await client .prompts .getParameters (' 1212121' ).withResponse ();
256+ const { data : completionCreateResponse, response : raw } = await client .completion
257+ .create (' 1212121' )
258+ .withResponse ();
255259console .log (raw .headers .get (' X-My-Header' ));
256- console .log (modelParameters );
260+ console .log (completionCreateResponse . message );
257261```
258262
259263### Making custom/undocumented requests
@@ -357,7 +361,7 @@ const client = new PromptFoundry({
357361});
358362
359363// Override per-request:
360- await client .prompts . getParameters (' 1212121' , {
364+ await client .completion . create (' 1212121' , {
361365 httpAgent: new http .Agent ({ keepAlive: false }),
362366});
363367```
0 commit comments