npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@brian-ai/sdk

v0.3.4

Published

Official Typescript SDK for Brian AI.

Downloads

954

Readme

@brian-ai/sdk

Welcome to the official repository for the Brian Typescript SDK.

📦 Installation

The Brian SDK is available as an npm package. In order to add it to your project, you need to run one of the following commands:

# Using npm
npm install @brian-ai/sdk

# Using yarn
yarn add @brian-ai/sdk

# Using pnpm
pnpm add @brian-ai/sdk

# Using bun
bun add @brian-ai/sdk

⚒️ Usage

Once you have it installed in your project, you just need to import it and instantiate a new BrianSDK object:

// Using ES6 imports
import { BrianSDK } from "@brian-ai/sdk";

const options = {
  apiKey: process.env.BRIAN_API_KEY,
};

const brian = new BrianSDK(options);

// Using CommonJS imports
const { BrianSDK } = require("@brian-ai/sdk");

const brian = new BrianSDK(options);

⚙️ SDK initialization options

The BrianSDK constructor accepts an object with the following properties:

| Property | Type | Description | Required | | ------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | | apiUrl | string | The API url you'll be calling. Default is https://api.brianknows.org for EU based projects. YOu can change it with https://us-api.brianknows.org for better latency in the US. | ❌ | | apiKey | string | The API key used to call the Brian APIs. | ✅ | | apiVersion | v0 | The API version. Only v0 is available right now. | ❌ |

📚 SDK methods

The BrianSDK object exposes the following methods:

| Method name | Description | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | ask | Calls the Brian API /agent/knowledge method. Returns an AI-generated for the given prompt. | | extract | Calls the Brian API /agent/parameters-extraction method. Returns the extracted parameters from the given prompt | | generateCode | Calls the Brian API /agent/smart-contracts method. Returns an AI-generated Solidity Smart Contract based on the prompt. | | transact | Calls the Brian API /agent/transaction method. Returns one or more transactions ready to be executed, generated from the given prompt. |

📖 Examples

Check the tests/index.tests.ts file to see some examples on how to use the SDK.

🤝 Changelog

Check the CHANGELOG for the latests changes in the SDK.

🛡️ License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

‼️ Disclaimer

This code is being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the code. It has not been audited and as such there can be no assurance it will work as intended, and users may experience delays, failures, errors, omissions or loss of transmitted information. Nothing in this repo should be construed as investment advice or legal advice for any particular facts or circumstances and is not meant to replace competent counsel. It is strongly advised for you to contact a reputable attorney in your jurisdiction for any questions or concerns with respect thereto. Brian is not liable for any use of the foregoing, and users should proceed with caution and use at their own risk.