GithubHelp home page GithubHelp logo

xinparkn / brian-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brian-knows/brian-sdk

0.0 0.0 0.0 157 KB

The official repository of the Typescript SDK for interacting with Brian APIs.

License: MIT License

TypeScript 100.00%

brian-sdk's Introduction

@brian/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/sdk

# Using yarn
yarn add @brian/sdk

# Using pnpm
pnpm add @brian/sdk

# Using bun
bun add @brian/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/sdk";

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

const brian = new BrianSDK(options);

// Using CommonJS imports
const { BrianSDK } = require("@brian/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.

brian-sdk's People

Contributors

paolorollo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.