jinaai


Namejinaai JSON
Version 0.2.10 PyPI version JSON
download
home_pagehttps://github.com/jina-ai/jinaai-py.git
SummaryJina AI Python SDK
upload_time2024-01-25 08:39:42
maintainer
docs_urlNone
authorJina AI
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # JinaAI Python SDK

The JinaAI Python SDK is an efficient instrument that smoothly brings the power of JinaAI's products — [SceneXplain](https://scenex.jina.ai), [PromptPerfect](https://promptperfect.jina.ai/), [Rationale](https://rationale.jina.ai/), [BestBanner](https://bestbanner.jina.ai/), and [JinaChat](https://chat.jina.ai/) — into Python applications. Acting as a sturdy interface for JinaAI's APIs, this SDK lets you effortlessly formulate and fine-tune prompts, thus streamlining application development.

## Installing

### Package manager

Using pip:
```bash
$ pip install jinaai
```

## API secrets

To generate an API secret, you need to authenticate on each respective platform's API tab:

- [SceneXplain API](https://scenex.jina.ai/api)
- [PromptPerfect API](https://promptperfect.jina.ai/api)
- [Rationale API](https://rationale.jina.ai/api)
- [JinaChat API](https://chat.jina.ai/api)
- [BestBanner API](https://bestbanner.jina.ai/api)

> **Note:** Each secret is product-specific and cannot be interchanged. If you're planning to use multiple products, you'll need to generate a separate secret for each.

## Example usage


Import the SDK and instantiate a new client with your authentication secrets:

```python
from jinaai import JinaAI

jinaai = JinaAI(
    secrets = {
        'promptperfect-secret': 'XXXXXX',
        'scenex-secret': 'XXXXXX',
        'rationale-secret': 'XXXXXX',
        'jinachat-secret': 'XXXXXX',
        'bestbanner-secret': 'XXXXXX',
    }
)
```

Describe images:

```python
descriptions = jinaai.describe(
    'https://picsum.photos/200'
)
```

Evaluate situations:

```python
decisions = jinaai.decide(
    'Going to Paris this summer', 
    { 'analysis': 'proscons' }
)
```

Optimize prompts:

```python
prompts = jinaai.optimize(
    'Write an Hello World function in Python'
)
```

Generate complex answers:

```python
output = jinaai.generate(
    'Give me a recipe for a pizza with pineapple'
)
```

Create images from text:

```python
output = jinaai.imagine(
    'A controversial fusion of sweet pineapple and savory pizza.'
)
```

Use APIs together:

```python
situations = [toBase64(img) for img in [
    'factory-1.png',
    'factory-2.png',
    'factory-3.png',
    'factory-4.png',
]]

descriptions = jinaai.describe(situations)

prompt1 = [
    'Do any of those situations present a danger?',
    'Reply with [YES] or [NO] and explain why',
    *['SITUATION:\n' + desc['output'] for i, desc in enumerate(descriptions['results'])]
]

analysis = jinaai.generate('\n'.join(prompt1))

prompt2 = [
    'What should be done first to make those situations safer?',
    'I only want the most urgent situation',
    *['SITUATION:\n' + desc['output'] for i, desc in enumerate(descriptions['results'])]
]

recommendation = jinaai.generate('\n'.join(propmt2))

swot = jinaai.decide(
    recommendation['output'],
    { 'analysis': 'swot' }
)

banners = jinaai.imagine(
    *[desc['output'] for i, desc in enumerate(descriptions['results'])]
)
```

## Raw Output

You can retrieve the raw output of each APIs by passing `raw: True` in the options:

```python
descriptions = jinaai.describe(
    'https://picsum.photos/200',
    { 'raw': True }
)

print(descriptions['raw'])
```

## Custom Base Urls

Custom base Urls can be passed directly in the client's constructor:

```python
jinaai = JinaAI(
    baseUrls={
        'promptperfect': 'https://promptperfect-customurl.jina.ai',
        'scenex': 'https://scenex-customurl.jina.ai',
        'rationale': 'https://rationale-customurl.jina.ai',
        'jinachat': 'https://jinachat-customurl.jina.ai',
        'bestbanner': 'https://bestbanner-customurl.jina.ai',
    }
)
```

## API Documentation

### JinaAi.describe

```python
output = JinaAI.describe(input, options)
```

- Input

>| VARIABLE                              | TYPE              | VALUE 
>|---------------------------------------|-------------------|----------
>| input                                 | str / str array   | Image URL or Base64

- Options

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| options                                | dict              | 
>| options['algorithm']                   | None / str        | Aqua / Bolt / Comet / Dune / Ember / Flash / Glide / Hearth / Inception / Jelly
>| options['features']                    | None / str array  | high_quality, question_answer, tts, opt-out, json
>| options['languages']                   | None / str array  | en, cn, de, fr, it...
>| options['question']                    | None / str        | Question related to the picture(s)
>| options['style']                       | None / str        | default / concise / prompt
>| options['output_length']               | None / number     |
>| options['json_schema']                 | None / dict       |
>| options['callback_url']                | None / string     |

- Output

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| output                                 | dict              | 
>| output['results']                      | dict array        | 
>| results[0]['output']                   | str               | The picture description
>| results[0]['i18n']                     | dict              | Contains one key for each item in languages
>| ...i18n['cn']                          | str               | The translated picture description
>| ...i18n['cn']                          | dict array        | Only for Hearth algorithm
>| ...i18n['cn'][0]                       | dict              | 
>| ...i18n['cn'][0]['message']            | str               | 
>| ...i18n['cn'][0]['isNarrator']         | boolean           | 
>| ...i18n['cn'][0]['name']               | str               | 
>| ...i18n['cn']                          | dict array        | Only for Inception algorithm
>| ...i18n['cn'][0]                       | dict              | 
>| ...i18n['cn'][0]['summary']            | str               | 
>| ...i18n['cn'][0]['events']             | dict array        | 
>| ...['events']['description']           | str               | 
>| ...['events']['timestamp']             | str               | 
>| results[0]['tts']                      | dict              | Only for Hearth algorithm
>| ...tts['cn']                           | str               | Contains the url to the tts file
>| results[0]['ssml']                     | dict              | Only for Hearth algorithm
>| ...ssml['cn']                          | str               | Contains the url to the ssml file

<br/>

### JinaAi.optimize

```python
output = JinaAI.optimize(input, options)
```

- Input

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| input                                  | str / str array   | Image URL or Base64 / prompt to optimize

- Options

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| options                                | dict              | 
>| options['targetModel']                 | None / str        | chatgpt / gpt-4 / stablelm-tuned-alpha-7b / claude / cogenerate / text-davinci-003 / dalle / sd / midjourney / kandinsky / lexica
>| options['features']                    | None / str array  | preview, no_spam, shorten, bypass_ethics, same_language, always_en, high_quality, redo_original_image, variable_subs, template_run
>| options['iterations']                  | None / number     | Default: 1
>| options['previewSettings']             | None / dict       | Contains the settings for the preview
>| ...previewSettings['temperature']      | number            | Example: 0.9
>| ...previewSettings['topP']             | number            | Example: 0.9
>| ...previewSettings['topK']             | number            | Example: 0
>| ...previewSettings['frequencyPenalty'] | number            | Example: 0
>| ...previewSettings['presencePenalty']  | number            | Example: 0
>| options['previewVariables']            | None / dict       | Contains one key for each variables in the prompt
>| ...previewVariables['var1']            | str               | The value of the variable
>| options['timeout']                     | Number            | Default: 20000
>| options['target_language']             | None / str        | en / cn / de / fr / it...

- Output

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| output                                 | dict              | 
>| output['results']                      | dict array        | 
>| results[0]['output']                   | str               | The optimized prompt

<br/>

### JinaAi.decide

```python
output = JinaAI.decide(input, options)
```

- Input

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| input                                  | str / str array   | Decision to evaluate

- Options

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| options                                | dict              | 
>| options['analysis']                    | None / str        | proscons / swot / multichoice / outcomes
>| options['style']                       | None / str        | concise / professional / humor / sarcastic / childish / genZ
>| options['profileId']                   | None / str        | The id of the Personas you want to use

- Output

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| output                                 | dict              | 
>| output['results']                      | dict array        | 
>| results[0]['proscons']                 | None / dict       |
>| ...proscons['pros']                    | dict              | Contains one key for each pros
>| ...proscons['pros']['pros1']           | str               | The explanation of the pros
>| ...proscons['cons']                    | dict              | Contains one key for each cons
>| ...proscons['cons']['cons1']           | str               | The explanation of the cons
>| ...proscons['bestChoice']              | str               | 
>| ...proscons['conclusion']              | str               | 
>| ...proscons['confidenceScore']         | number            | 
>| results[0]['swot']                     | None / dict       |
>| ...swot['strengths']                   | dict              | Contains one key for each strength
>| ...swot['strengths']['str1']           | str               | The explanation of the strength
>| ...swot['weaknesses']                  | dict              | Contains one key for each weakness
>| ...swot['weaknesses']['weak1']         | str               | The explanation of the weakness
>| ...swot['opportunities']               | dict              | Contains one key for each opportunity
>| ...swot['opportunities']['opp1']       | str               | The explanation of the opportunity
>| ...swot['threats']                     | dict              | Contains one key for each threat
>| ...swot['threats']['thre1']            | str               | The explanation of the threat
>| ...swot['bestChoice']                  | str               | 
>| ...swot['conclusion']                  | str               | 
>| ...swot['confidenceScore']             | number            | 
>| results[0]['multichoice']              | None / dict       | Contains one key for each choice
>| ...multichoice['choice1']              | str               | The value of the choice
>| results[0]['outcomes']                 | None / dict array |
>| ...outcomes[0]['children']             | None / dict array | a recursive array of results['outcomes']
>| ...outcomes[0]['label']                | str               | 
>| ...outcomes[0]['sentiment']            | str               | 

<br/>

### JinaAi.generate

```python
output = JinaAI.generate(input, options)
```

- Input

>| VARIABLE                               | TYPE                   | VALUE 
>|----------------------------------------|------------------------|----------
>| input                                  | str / str array        | Image URL or Base64 / prompt

- Options

>| VARIABLE                               | TYPE                   | VALUE 
>|----------------------------------------|------------------------|----------
>| options                                | dict                   | 
>| options['role']                        | None / str             | user / assistant
>| options['name']                        | None / str             | The name of the author of this message
>| options['chatId']                      | None / str             | The id of the conversation to continue
>| options['stream']                      | None / boolean         | Whether to stream back partial progress, Default: false
>| options['temperature']                 | None / number          | Default: 1
>| options['top_p']                       | None / str             | Default: 1
>| options['stop']                        | None / str / str array | Up to 4 sequences where the API will stop generating further tokens
>| options['max_tokens']                  | None / number          | Default: infinite
>| options['presence_penalty']            | None / number          | Number between -2.0 and 2.0, Default: 0
>| options['frequency_penalty']           | None / number          | Number between -2.0 and 2.0, Default: 0
>| options['logit_bias']                  | None / dict            | The likelihood for a token to appear in the completion
>| ...logit_bias['tokenId']               | number                 | Bias value from -100 to 100
>| options['image']                       | str                    | The attached image of the message. The image can be either a URL or a base64-encoded string

- Output

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| output                                 | dict              | 
>| output['output']                       | str               | The generated answer
>| output['chatId']                       | str               | The chatId to continue the conversation

<br/>

### JinaAi.imagine

```python
output = JinaAI.imagine(input, options)
```

- Input

>| VARIABLE                               | TYPE                   | VALUE 
>|----------------------------------------|------------------------|----------
>| input                                  | str / str array        | Prompt

- Options

>| VARIABLE                               | TYPE                   | VALUE 
>|----------------------------------------|------------------------|----------
>| options                                | dict                   | 
>| options['style']                       | None / str             | default / photographic / minimalist / flat

- Output

>| VARIABLE                               | TYPE              | VALUE 
>|----------------------------------------|-------------------|----------
>| output                                 | dict              | 
>| output['results']                      | dict array        |
>| results[0]['output']                   | array             | array of 4 image urls

<br/>

### JinaAi.utils

```python
outout = JinaAI.utils.image_to_base64(input)
```

>| VARIABLE                              | TYPE              | VALUE 
>|---------------------------------------|-------------------|----------
>| input                                 | str               | Image path on disk
>| output                                | str               | Base64 image

```python
outout = JinaAI.utils.is_url(input)
```

>| VARIABLE                              | TYPE              | VALUE 
>|---------------------------------------|-------------------|----------
>| input                                 | str               | 
>| output                                | boolean           | 

```python
outout = JinaAI.utils.is_base64(input)
```

>| VARIABLE                              | TYPE              | VALUE 
>|---------------------------------------|-------------------|----------
>| input                                 | str               | 
>| output                                | boolean           | 



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jina-ai/jinaai-py.git",
    "name": "jinaai",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Jina AI",
    "author_email": "guillaume.roncari@jina.ai",
    "download_url": "https://files.pythonhosted.org/packages/3a/5a/3c5062541d0cddf33d3295a2ec696aa45ee199e61341c831e96cdde96d16/jinaai-0.2.10.tar.gz",
    "platform": null,
    "description": "# JinaAI Python SDK\n\nThe JinaAI Python SDK is an efficient instrument that smoothly brings the power of JinaAI's products \u2014 [SceneXplain](https://scenex.jina.ai), [PromptPerfect](https://promptperfect.jina.ai/), [Rationale](https://rationale.jina.ai/), [BestBanner](https://bestbanner.jina.ai/), and [JinaChat](https://chat.jina.ai/) \u2014 into Python applications. Acting as a sturdy interface for JinaAI's APIs, this SDK lets you effortlessly formulate and fine-tune prompts, thus streamlining application development.\n\n## Installing\n\n### Package manager\n\nUsing pip:\n```bash\n$ pip install jinaai\n```\n\n## API secrets\n\nTo generate an API secret, you need to authenticate on each respective platform's API tab:\n\n- [SceneXplain API](https://scenex.jina.ai/api)\n- [PromptPerfect API](https://promptperfect.jina.ai/api)\n- [Rationale API](https://rationale.jina.ai/api)\n- [JinaChat API](https://chat.jina.ai/api)\n- [BestBanner API](https://bestbanner.jina.ai/api)\n\n> **Note:** Each secret is product-specific and cannot be interchanged. If you're planning to use multiple products, you'll need to generate a separate secret for each.\n\n## Example usage\n\n\nImport the SDK and instantiate a new client with your authentication secrets:\n\n```python\nfrom jinaai import JinaAI\n\njinaai = JinaAI(\n    secrets = {\n        'promptperfect-secret': 'XXXXXX',\n        'scenex-secret': 'XXXXXX',\n        'rationale-secret': 'XXXXXX',\n        'jinachat-secret': 'XXXXXX',\n        'bestbanner-secret': 'XXXXXX',\n    }\n)\n```\n\nDescribe images:\n\n```python\ndescriptions = jinaai.describe(\n    'https://picsum.photos/200'\n)\n```\n\nEvaluate situations:\n\n```python\ndecisions = jinaai.decide(\n    'Going to Paris this summer', \n    { 'analysis': 'proscons' }\n)\n```\n\nOptimize prompts:\n\n```python\nprompts = jinaai.optimize(\n    'Write an Hello World function in Python'\n)\n```\n\nGenerate complex answers:\n\n```python\noutput = jinaai.generate(\n    'Give me a recipe for a pizza with pineapple'\n)\n```\n\nCreate images from text:\n\n```python\noutput = jinaai.imagine(\n    'A controversial fusion of sweet pineapple and savory pizza.'\n)\n```\n\nUse APIs together:\n\n```python\nsituations = [toBase64(img) for img in [\n    'factory-1.png',\n    'factory-2.png',\n    'factory-3.png',\n    'factory-4.png',\n]]\n\ndescriptions = jinaai.describe(situations)\n\nprompt1 = [\n    'Do any of those situations present a danger?',\n    'Reply with [YES] or [NO] and explain why',\n    *['SITUATION:\\n' + desc['output'] for i, desc in enumerate(descriptions['results'])]\n]\n\nanalysis = jinaai.generate('\\n'.join(prompt1))\n\nprompt2 = [\n    'What should be done first to make those situations safer?',\n    'I only want the most urgent situation',\n    *['SITUATION:\\n' + desc['output'] for i, desc in enumerate(descriptions['results'])]\n]\n\nrecommendation = jinaai.generate('\\n'.join(propmt2))\n\nswot = jinaai.decide(\n    recommendation['output'],\n    { 'analysis': 'swot' }\n)\n\nbanners = jinaai.imagine(\n    *[desc['output'] for i, desc in enumerate(descriptions['results'])]\n)\n```\n\n## Raw Output\n\nYou can retrieve the raw output of each APIs by passing `raw: True` in the options:\n\n```python\ndescriptions = jinaai.describe(\n    'https://picsum.photos/200',\n    { 'raw': True }\n)\n\nprint(descriptions['raw'])\n```\n\n## Custom Base Urls\n\nCustom base Urls can be passed directly in the client's constructor:\n\n```python\njinaai = JinaAI(\n    baseUrls={\n        'promptperfect': 'https://promptperfect-customurl.jina.ai',\n        'scenex': 'https://scenex-customurl.jina.ai',\n        'rationale': 'https://rationale-customurl.jina.ai',\n        'jinachat': 'https://jinachat-customurl.jina.ai',\n        'bestbanner': 'https://bestbanner-customurl.jina.ai',\n    }\n)\n```\n\n## API Documentation\n\n### JinaAi.describe\n\n```python\noutput = JinaAI.describe(input, options)\n```\n\n- Input\n\n>| VARIABLE                              | TYPE              | VALUE \n>|---------------------------------------|-------------------|----------\n>| input                                 | str / str array   | Image URL or Base64\n\n- Options\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| options                                | dict              | \n>| options['algorithm']                   | None / str        | Aqua / Bolt / Comet / Dune / Ember / Flash / Glide / Hearth / Inception / Jelly\n>| options['features']                    | None / str array  | high_quality, question_answer, tts, opt-out, json\n>| options['languages']                   | None / str array  | en, cn, de, fr, it...\n>| options['question']                    | None / str        | Question related to the picture(s)\n>| options['style']                       | None / str        | default / concise / prompt\n>| options['output_length']               | None / number     |\n>| options['json_schema']                 | None / dict       |\n>| options['callback_url']                | None / string     |\n\n- Output\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| output                                 | dict              | \n>| output['results']                      | dict array        | \n>| results[0]['output']                   | str               | The picture description\n>| results[0]['i18n']                     | dict              | Contains one key for each item in languages\n>| ...i18n['cn']                          | str               | The translated picture description\n>| ...i18n['cn']                          | dict array        | Only for Hearth algorithm\n>| ...i18n['cn'][0]                       | dict              | \n>| ...i18n['cn'][0]['message']            | str               | \n>| ...i18n['cn'][0]['isNarrator']         | boolean           | \n>| ...i18n['cn'][0]['name']               | str               | \n>| ...i18n['cn']                          | dict array        | Only for Inception algorithm\n>| ...i18n['cn'][0]                       | dict              | \n>| ...i18n['cn'][0]['summary']            | str               | \n>| ...i18n['cn'][0]['events']             | dict array        | \n>| ...['events']['description']           | str               | \n>| ...['events']['timestamp']             | str               | \n>| results[0]['tts']                      | dict              | Only for Hearth algorithm\n>| ...tts['cn']                           | str               | Contains the url to the tts file\n>| results[0]['ssml']                     | dict              | Only for Hearth algorithm\n>| ...ssml['cn']                          | str               | Contains the url to the ssml file\n\n<br/>\n\n### JinaAi.optimize\n\n```python\noutput = JinaAI.optimize(input, options)\n```\n\n- Input\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| input                                  | str / str array   | Image URL or Base64 / prompt to optimize\n\n- Options\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| options                                | dict              | \n>| options['targetModel']                 | None / str        | chatgpt / gpt-4 / stablelm-tuned-alpha-7b / claude / cogenerate / text-davinci-003 / dalle / sd / midjourney / kandinsky / lexica\n>| options['features']                    | None / str array  | preview, no_spam, shorten, bypass_ethics, same_language, always_en, high_quality, redo_original_image, variable_subs, template_run\n>| options['iterations']                  | None / number     | Default: 1\n>| options['previewSettings']             | None / dict       | Contains the settings for the preview\n>| ...previewSettings['temperature']      | number            | Example: 0.9\n>| ...previewSettings['topP']             | number            | Example: 0.9\n>| ...previewSettings['topK']             | number            | Example: 0\n>| ...previewSettings['frequencyPenalty'] | number            | Example: 0\n>| ...previewSettings['presencePenalty']  | number            | Example: 0\n>| options['previewVariables']            | None / dict       | Contains one key for each variables in the prompt\n>| ...previewVariables['var1']            | str               | The value of the variable\n>| options['timeout']                     | Number            | Default: 20000\n>| options['target_language']             | None / str        | en / cn / de / fr / it...\n\n- Output\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| output                                 | dict              | \n>| output['results']                      | dict array        | \n>| results[0]['output']                   | str               | The optimized prompt\n\n<br/>\n\n### JinaAi.decide\n\n```python\noutput = JinaAI.decide(input, options)\n```\n\n- Input\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| input                                  | str / str array   | Decision to evaluate\n\n- Options\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| options                                | dict              | \n>| options['analysis']                    | None / str        | proscons / swot / multichoice / outcomes\n>| options['style']                       | None / str        | concise / professional / humor / sarcastic / childish / genZ\n>| options['profileId']                   | None / str        | The id of the Personas you want to use\n\n- Output\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| output                                 | dict              | \n>| output['results']                      | dict array        | \n>| results[0]['proscons']                 | None / dict       |\n>| ...proscons['pros']                    | dict              | Contains one key for each pros\n>| ...proscons['pros']['pros1']           | str               | The explanation of the pros\n>| ...proscons['cons']                    | dict              | Contains one key for each cons\n>| ...proscons['cons']['cons1']           | str               | The explanation of the cons\n>| ...proscons['bestChoice']              | str               | \n>| ...proscons['conclusion']              | str               | \n>| ...proscons['confidenceScore']         | number            | \n>| results[0]['swot']                     | None / dict       |\n>| ...swot['strengths']                   | dict              | Contains one key for each strength\n>| ...swot['strengths']['str1']           | str               | The explanation of the strength\n>| ...swot['weaknesses']                  | dict              | Contains one key for each weakness\n>| ...swot['weaknesses']['weak1']         | str               | The explanation of the weakness\n>| ...swot['opportunities']               | dict              | Contains one key for each opportunity\n>| ...swot['opportunities']['opp1']       | str               | The explanation of the opportunity\n>| ...swot['threats']                     | dict              | Contains one key for each threat\n>| ...swot['threats']['thre1']            | str               | The explanation of the threat\n>| ...swot['bestChoice']                  | str               | \n>| ...swot['conclusion']                  | str               | \n>| ...swot['confidenceScore']             | number            | \n>| results[0]['multichoice']              | None / dict       | Contains one key for each choice\n>| ...multichoice['choice1']              | str               | The value of the choice\n>| results[0]['outcomes']                 | None / dict array |\n>| ...outcomes[0]['children']             | None / dict array | a recursive array of results['outcomes']\n>| ...outcomes[0]['label']                | str               | \n>| ...outcomes[0]['sentiment']            | str               | \n\n<br/>\n\n### JinaAi.generate\n\n```python\noutput = JinaAI.generate(input, options)\n```\n\n- Input\n\n>| VARIABLE                               | TYPE                   | VALUE \n>|----------------------------------------|------------------------|----------\n>| input                                  | str / str array        | Image URL or Base64 / prompt\n\n- Options\n\n>| VARIABLE                               | TYPE                   | VALUE \n>|----------------------------------------|------------------------|----------\n>| options                                | dict                   | \n>| options['role']                        | None / str             | user / assistant\n>| options['name']                        | None / str             | The name of the author of this message\n>| options['chatId']                      | None / str             | The id of the conversation to continue\n>| options['stream']                      | None / boolean         | Whether to stream back partial progress, Default: false\n>| options['temperature']                 | None / number          | Default: 1\n>| options['top_p']                       | None / str             | Default: 1\n>| options['stop']                        | None / str / str array | Up to 4 sequences where the API will stop generating further tokens\n>| options['max_tokens']                  | None / number          | Default: infinite\n>| options['presence_penalty']            | None / number          | Number between -2.0 and 2.0, Default: 0\n>| options['frequency_penalty']           | None / number          | Number between -2.0 and 2.0, Default: 0\n>| options['logit_bias']                  | None / dict            | The likelihood for a token to appear in the completion\n>| ...logit_bias['tokenId']               | number                 | Bias value from -100 to 100\n>| options['image']                       | str                    | The attached image of the message. The image can be either a URL or a base64-encoded string\n\n- Output\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| output                                 | dict              | \n>| output['output']                       | str               | The generated answer\n>| output['chatId']                       | str               | The chatId to continue the conversation\n\n<br/>\n\n### JinaAi.imagine\n\n```python\noutput = JinaAI.imagine(input, options)\n```\n\n- Input\n\n>| VARIABLE                               | TYPE                   | VALUE \n>|----------------------------------------|------------------------|----------\n>| input                                  | str / str array        | Prompt\n\n- Options\n\n>| VARIABLE                               | TYPE                   | VALUE \n>|----------------------------------------|------------------------|----------\n>| options                                | dict                   | \n>| options['style']                       | None / str             | default / photographic / minimalist / flat\n\n- Output\n\n>| VARIABLE                               | TYPE              | VALUE \n>|----------------------------------------|-------------------|----------\n>| output                                 | dict              | \n>| output['results']                      | dict array        |\n>| results[0]['output']                   | array             | array of 4 image urls\n\n<br/>\n\n### JinaAi.utils\n\n```python\noutout = JinaAI.utils.image_to_base64(input)\n```\n\n>| VARIABLE                              | TYPE              | VALUE \n>|---------------------------------------|-------------------|----------\n>| input                                 | str               | Image path on disk\n>| output                                | str               | Base64 image\n\n```python\noutout = JinaAI.utils.is_url(input)\n```\n\n>| VARIABLE                              | TYPE              | VALUE \n>|---------------------------------------|-------------------|----------\n>| input                                 | str               | \n>| output                                | boolean           | \n\n```python\noutout = JinaAI.utils.is_base64(input)\n```\n\n>| VARIABLE                              | TYPE              | VALUE \n>|---------------------------------------|-------------------|----------\n>| input                                 | str               | \n>| output                                | boolean           | \n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Jina AI Python SDK",
    "version": "0.2.10",
    "project_urls": {
        "Homepage": "https://github.com/jina-ai/jinaai-py.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a996a379d7a65f151bc5da59d6fb22d7b116790e9352c08022acbfaff1e61a14",
                "md5": "562290290e29cdf02477d7350a980513",
                "sha256": "c22659283eb258d3616337e0f8e2414156b47fd18248e6a6e7c70030fa85c05c"
            },
            "downloads": -1,
            "filename": "jinaai-0.2.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "562290290e29cdf02477d7350a980513",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16187,
            "upload_time": "2024-01-25T08:39:39",
            "upload_time_iso_8601": "2024-01-25T08:39:39.991389Z",
            "url": "https://files.pythonhosted.org/packages/a9/96/a379d7a65f151bc5da59d6fb22d7b116790e9352c08022acbfaff1e61a14/jinaai-0.2.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a5a3c5062541d0cddf33d3295a2ec696aa45ee199e61341c831e96cdde96d16",
                "md5": "17295788c0526decca58f9b63563424f",
                "sha256": "0a4990eec0c557e99e96d81981da4f244757af990143f214ca2029abafb6205d"
            },
            "downloads": -1,
            "filename": "jinaai-0.2.10.tar.gz",
            "has_sig": false,
            "md5_digest": "17295788c0526decca58f9b63563424f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 15581,
            "upload_time": "2024-01-25T08:39:42",
            "upload_time_iso_8601": "2024-01-25T08:39:42.355368Z",
            "url": "https://files.pythonhosted.org/packages/3a/5a/3c5062541d0cddf33d3295a2ec696aa45ee199e61341c831e96cdde96d16/jinaai-0.2.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-25 08:39:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jina-ai",
    "github_project": "jinaai-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jinaai"
}
        
Elapsed time: 0.20282s