Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
add a code sample showing a shorter way for content generation.
  • Loading branch information
Barqawiz authored May 4, 2023
1 parent 8e5635a commit 9f639c8
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ npm i intellinode

## Examples
### Language models
imports:
import:
```js
const { RemoteLanguageModel, LanguageModelInput } = require('intellinode');
```
Expand All @@ -65,7 +65,7 @@ model_name = 'command-xlarge-20221108'

### Image models

imports:
import:
```js
const { RemoteImageModel, SupportedImageModels, ImageModelInput } = require('intellinode');
```
Expand All @@ -87,7 +87,7 @@ provider=SupportedImageModels.STABILITY;
// ... same code
```
### Chatbot (chatGPT)
imports:
import:
```js
const { Chatbot, ChatGPTInput } = require('intellinode');
```
Expand All @@ -101,22 +101,33 @@ input.addUserMessage('What is the distance between the Earth and the Moon?');
const responses = await chatbot.chat(input);
```
### Semantic search
imports:
import:
```js
const { SemanticSearch } = require('intellinode');
```
call:
```js
const search = new SemanticSearch(apiKey);
// pivotItem is the item to search.
// searchArray is the array of strings to search through.
const results = await search.getTopMatches(pivotItem, searchArray, numberOfMatches);
const filteredArray = search.filterTopMatches(results, searchArray)
```
### Gen
`Gen` function quickly generate content that is tailored to your specific business needs.<br>
import:
```js
const { Gen } = require('intellinode');
```
call:
```js
// one line to generate marketing description
const marketingDesc = await Gen.get_marketing_desc('gaming chair', openaiApiKey);

// or generate images from products description
const image = await Gen.generate_image_from_desc(prompt, openaiApiKey, stabilityApiKey, true);
```
For more examples, check [the samples](https://github.com/Barqawiz/IntelliNode/tree/main/samples/command_sample).


# The code repository setup
## First setup
1. Initiate the project:
Expand Down

0 comments on commit 9f639c8

Please sign in to comment.