Skip to content

Commit

Permalink
chore: use new free service in playground (#844)
Browse files Browse the repository at this point in the history
* chore: use the new free service

* chore: minor revision
  • Loading branch information
numb3r3 authored Oct 24, 2022
1 parent baf94b5 commit ae05624
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
5 changes: 4 additions & 1 deletion docs/_static/demo-embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
var app = new Vue({
el: '#demo-embed',
data: {
serverAddress: `https://demo-cas.jina.ai:8443`,
serverAddress: `https://api.clip.jina.ai:8443`,
query: 'First do it, then do it right, then do it better',
embedding: [1, 1, 1],
max_embed_value: 0,
Expand Down Expand Up @@ -185,6 +185,9 @@
callJina: function () {

$.ajax({
headers: {
Authorization: "d28b93ccbd13367148d05fe3f7fbc680"
},
type: "POST",
url: this.serverAddress + "/post",
data: JSON.stringify(this.payload),
Expand Down
5 changes: 4 additions & 1 deletion docs/_static/demo-text-rank.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
var app = new Vue({
el: '#demo-embed',
data: {
serverAddress: `https://demo-cas.jina.ai:8443`,
serverAddress: `https://api.clip.jina.ai:8443`,
query: 'https://picsum.photos/300',
embedding: [1, 1, 1],
max_embed_value: 0,
Expand Down Expand Up @@ -220,6 +220,9 @@
callJina: function () {

$.ajax({
headers: {
Authorization: "d28b93ccbd13367148d05fe3f7fbc680"
},
type: "POST",
url: this.serverAddress + "/post",
data: JSON.stringify(this.payload),
Expand Down
20 changes: 17 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,26 @@

## Try it!

An always-online demo server loaded with `ViT-L/14-336px` is there for you to play & test:
An always-online server `api.clip.jina.ai` loaded with `ViT-L/14-336px` is there for you to play & test.

Before you start, make sure you have created access token from our [console website](https://console.clip.jina.ai/get_started),
or CLI as described in [this guide](https://github.com/jina-ai/jina-hubble-sdk#create-a-new-pat).

```bash
jina auth token create <name of PAT> -e <expiration days>
```

Then, you need to set the created token in HTTP request header `Authorization` as `<your access token>`,
or configure it in the parameter `credential` of the client in python.


````{tab} via HTTPS 🔐
```bash
curl \
-X POST https://demo-cas.jina.ai:8443/post \
-X POST https://api.clip.jina.ai:8443/post \
-H 'Content-Type: application/json' \
-H 'Authorization: <your access token>' \
-d '{"data":[{"text": "First do it"},
{"text": "then do it right"},
{"text": "then do it better"},
Expand All @@ -33,7 +45,9 @@ pip install clip-client
```python
from clip_client import Client
c = Client('grpcs://demo-cas.jina.ai:2096')
c = Client(
'grpcs://api.clip.jina.ai:2096', credential={'Authorization': '<your access token>'}
)
r = c.encode(
[
Expand Down

0 comments on commit ae05624

Please sign in to comment.