GithubHelp home page GithubHelp logo

mkr / vectara-getting-started Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vectara/getting-started

0.0 0.0 0.0 569 KB

Examples of how to use the Vectara platform in several common programming languages

License: Apache License 2.0

Shell 0.96% JavaScript 9.88% Python 14.68% PHP 11.04% Java 23.09% C# 19.78% CSS 0.90% HTML 19.67%

vectara-getting-started's Introduction

README

Cloning the Repository

This repository links a git submodule that contains the Vectara proto definitions needed for grpc calls. In order to properly clone this repository, use the --recurse-submodules flag in the clone command like following:

git clone --recurse-submodules https://<RepoPath>

Doing this will ensure that the submodule containing proto definitions is fetched as well.

If you have already cloned the repository, without using above flag, then you can run following two commands to fetch the submodule:

  1. git submodule init
  2. git submodule update

Authentication

Vectara APIs require authentication of some form to work. Following are the two authentication methods that are supported.

  1. OAuth2
  2. API Keys

OAuth2

An API User's first step is to obtain a JWT Token. To obtain JWT Token, following steps need to be done.

  1. Create an App Client in Vectara Console.
  2. Assign appropriate rights to this App client over a corpus. These rights can be QRY, IDX, ADM or a combination of these three.
  3. Note down the following three things from App Client page in Console.
    1. App Client ID
    2. App Client Secret
    3. Auth URL (This is available near the top of the page)
  4. Also note down your Vectara customer ID and the Corpus ID (of the corpus you want to index data to, or query.)

Once you have all the above data, you can use it to obtain a valid JWT Auth token. With this token, you can make API calls to index data, query data and/or perform certain admin tasks such as create corpus, delete corpus, etc.

All of this is demonstrated in the code. For further clarification, please see the code.

Please note that your App Client needs to have sufficient privileges to perform indexing, querying or admin tasks. These privileges can be assigned in Vectara console.

API Keys

The API Key authentication method is supported with Serving/Querying only.

Use the following link to generate an API Key via Vectara platform. Api Keys

While generating an API Key, make sure that you have assigned the correct corpus to it.

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.