Tags: copilot-extensions/preview-sdk.js
Tags
feat: support caching of verification kys (#81) ## Summary Closes #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>
feat: `create*Event` methods now return strings (#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` (#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`**
PreviousNext