Tags: tspascoal/preview-sdk.js
Tags
feat: support caching of verification kys (copilot-extensions#81) ## Summary Closes copilot-extensions#9 Previously, clients who fetched verification keys from the server had no way to cache those keys and reuse them for other requests. This PR proposes a change using the GitHub API's [conditional requests](https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate) feature: clients can optionally specify a cache for their keys and only fetch new ones if the cache is outdated. BREAKING CHANGE: `verifyRequestByKeyId() now returns an object with a `isValid` property and a`cache` property. Before ```js const isValid = await verifyRequestByKeyId(); ``` After ```js const { isValid, cache } = await verifyRequestByKeyId(); ``` BREAKING CHANGE: `fetchVerificationKeys()` now returns an object with a `keys` property and a`cache` property. Before ```js const keys = await fetchVerificationKeys(); ``` After ```js const { keys, cache } = await fetchVerificationKeys(); ``` --------- Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
fix: use `gpt-4o` as default model (copilot-extensions#63) this aligns with other uses across github
feat: `create*Event` methods now return strings (copilot-extensions#59) BREAKING CHANGE: All `create*Event` methods now return a string instead of an object with a `.toString()` method. Before: ```js esponse.write(createTextEvent("Hello, world!").toString()); ``` Now: ```js esponse.write(createTextEvent("Hello, world!")); ```
fix(prompt): `parameters.model` is now a string and is optional. It d… …efaults to `gpt-4` (copilot-extensions#53) - **fix(types): `ModelName` is a string now** - **docs(README): `model` parameter is no longer required for `prompt()`. It defaults to `gpt-4`** - **fix: `model` parameter is now optional for `prompt()`. It defaults to `gpt-4`**
feat: `options.messages` for `prompt()` (copilot-extensions#49)
PreviousNext