0.12.4 • Published 3 days ago

@automattic/jetpack-ai-client v0.12.4

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
3 days ago

Jetpack AI Client

JavaScript client for consuming Jetpack AI services. This client provides functionalities to fetch images and request completions from the Jetpack AI API as well as managing authentication tokens for the Jetpack AI streaming completion API.

Installation

To install the Jetpack AI Client, clone the repository to your local machine and install the dependencies with npm:

npm install @automattic/jetpack-ai-client

Libraries & Components

Requesting

askQuestion helper

Async function that sends a question and optional configurations, retrieves a JWT token, and returns a SuggestionsEventSource instance.

SuggestionsEventSouce Class

Class that connects to an AI model to receive and emit suggestion streams, using EventTarget for handling data chunks.

useAiSuggestions hook

A custom React hook that obtains suggestions from an AI by hitting a specific query endpoint.

JWT helper

Library to manage JWT tokens for Jetpack AI across various site types, handling acquisition, caching in localStorage, expiration, and customization of request options.

Data Flow implementation

Data Flow offers a streamlined way to manage an AI Assistant's state and functionality within a React app, using React context, HOCs, and custom hooks to handle suggestions, errors, and requests.

Components

AIControl

AiStatusIndicator

Icons

Contribute

React components useful for when you need to create some UI implementations.

We welcome contributions from the community. Please submit your pull requests on the GitHub repository.

Get Help

If you encounter any issues or have any questions, please open an issue on the GitHub repository.

Using this package in your WordPress plugin

If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

Jetpack AI Client is licensed under the GNU General Public License v2 (or later).

0.12.4

3 days ago

0.12.3

7 days ago

0.12.2

9 days ago

0.12.1

16 days ago

0.12.0

23 days ago

0.11.0

1 month ago

0.10.1

1 month ago

0.10.0

1 month ago

0.9.0

2 months ago

0.8.2

2 months ago

0.8.1

2 months ago

0.8.0

2 months ago

0.7.0

2 months ago

0.6.1

3 months ago

0.6.0

3 months ago

0.5.1

3 months ago

0.5.0

3 months ago

0.4.1

3 months ago

0.4.0

4 months ago

0.3.1

4 months ago

0.3.0

4 months ago

0.1.15

6 months ago

0.2.1

5 months ago

0.2.0

5 months ago

0.1.16

6 months ago

0.1.14

6 months ago

0.1.13

6 months ago

0.1.12

7 months ago

0.1.11

7 months ago

0.1.10

7 months ago

0.1.9

7 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago