Skip to content

Tags: copilot-extensions/preview-sdk.js

Tags

v5.0.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(readme): add `await` to `prompt.stream` example (#112)

Adds a small change to the `README.md` file. The change updates the
example code to use `await` with the `prompt.stream` method for proper
asynchronous handling.

v5.0.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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>

v4.0.3

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: set `index: 0` in choices as it is now required in copilot API (#76

)

v4.0.2

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(types): add `InteropMessageRole` (#75)

v4.0.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: use `gpt-4o` as default model (#63)

this aligns with other uses across github

v4.0.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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!"));
```

v3.0.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat(prompt): `prompt.stream()`, `options.endpoint` (#57)

BREAKING CHANGE: `prompt()` is now throwing an error if the API responds
with an error status code

v2.6.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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`**

v2.6.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat: `getFunctionCalls()` -b closes (#50)

v2.5.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat: `options.messages` for `prompt()` (#49)