Git Product home page Git Product logo

jinabox.js's Introduction

Jinabox.js banner

npm npm bundle size Jina Jina Box

jinabox.js is a lightweight, customizable omnibox. You can use it for searching text, images, videos, audios or all kinds of data with a Jina backend.

Quick Start

In HTML, include the minified script:

<script src="https://unpkg.com/jinabox"></script>
<script>
    jb = window.JinaBox
    jb.init('http://0.0.0.0:65481/api/search');  // http://0.0.0.0:65481/api/search is the endpoint of the REST gateway of a Jina backend.
</script>

Then, create a container where the searchbar/floater is to appear:

<jina-searchbar/>

<!--or-->

<jina-floater/>

Run one of those prebuilt backend:

  • Pokedex (real image data): docker run -p 65481:65481 -e "JINA_PORT=65481" jinaai/hub.app.bitsearch-pokedex search
  • Southpark (real text data): docker run -p 45678:45678 jinaai/hub.app.distilbert-southpark
  • MP4 mock (placeholder video data): docker run -p 65481:65481 -e "JINA_PORT=65481" jinaai/hub.app.iomock.mp4 search
  • Wav mock (placeholder audio data): docker run -p 65481:65481 -e "JINA_PORT=65481" jinaai/hub.app.iomock.sound search

Now you can drag anything from anywhere (local/browser/webpage) to it and conduct the search.

Ready to learn Jina? Read our 101 tutorials.

Using with a module bundler

npm install jinabox
# or
yarn add jinabox

Features

  • an easy-to-use web component for Jina search backend;
  • allow user to drag-and-drop multi-modal data as queries to search;
  • webcam and mic support (in progress, contribution welcome! ❤️);
  • visualize the search results in a dropdown list or a separate container;
  • highly customizable.

Supported MIME types

MIME type Input (Query) Output (Result) Description
text typing list only Text-only data including any human-readable content, source code, or textual data such as comma-separated value (CSV) formatted data. Examples include text/plain, text/csv, and text/html.
image drag-and-drop <img> containers in list/grid view Image or graphical data including both bitmap and vector still images as well as animated versions of still image formats such as animated GIF or APNG. Common examples are image/jpeg, image/png, and image/svg+xml.
video drag-and-drop, webcam <video> containers in list/grid view Video data or files, such as MP4 movies (video/mp4).
audio drag-and-drop, webcam, mic <audio> containers in list view Audio or music data. Examples include audio/mpeg, audio/vorbis.

Configuration

Settings Description
theme Color theme: persian, pompelmo, honeybee, none
typewriterEffect Enable typewriter effect on the placeholder
typewriterDelayItem Time (ms) delays between every placeholder
typewriterDelayCharacter Time (ms) delays between every character

Browser support

jinabox.js runs on modern browsers supporting Web Audio, including Firefox, Chrome, Safari (desktop and mobile) and Opera.

Troubleshooting

SSL error on my localhost

Try http://localhost:65481/api/search, make sure to use http and localhost, instead of 0.0.0.0.

License

Copyright (c) 2020 Jina AI Limited. All rights reserved.

Jina is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

jinabox.js's People

Contributors

imsergiy avatar hanxiao avatar jina-bot avatar

Watchers

James Cloos 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.