Skip to content

Commit

Permalink
docs(api): update
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Dec 19, 2023
1 parent 427a856 commit 008a3db
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 29 deletions.
37 changes: 30 additions & 7 deletions docs/API/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ llama.rn

### Type Aliases

- [BenchResult](README.md#benchresult)
- [CompletionParams](README.md#completionparams)
- [ContextParams](README.md#contextparams)
- [TokenData](README.md#tokendata)
Expand All @@ -24,13 +25,35 @@ llama.rn

## Type Aliases

### BenchResult

Ƭ **BenchResult**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `modelDesc` | `string` |
| `modelNParams` | `number` |
| `modelSize` | `number` |
| `ppAvg` | `number` |
| `ppStd` | `number` |
| `tgAvg` | `number` |
| `tgStd` | `number` |

#### Defined in

[index.ts:43](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L43)

___

### CompletionParams

Ƭ **CompletionParams**: `Omit`<`NativeCompletionParams`, ``"emit_partial_completion"``\>

#### Defined in

[index.ts:40](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L40)
[index.ts:41](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L41)

___

Expand All @@ -40,7 +63,7 @@ ___

#### Defined in

[index.ts:38](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L38)
[index.ts:39](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L39)

___

Expand All @@ -57,7 +80,7 @@ ___

#### Defined in

[index.ts:28](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L28)
[index.ts:29](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L29)

## Functions

Expand All @@ -79,7 +102,7 @@ ___

#### Defined in

[grammar.ts:134](https://github.com/mybigday/llama.rn/blob/8738c99/src/grammar.ts#L134)
[grammar.ts:134](https://github.com/mybigday/llama.rn/blob/427a856/src/grammar.ts#L134)

___

Expand All @@ -99,7 +122,7 @@ ___

#### Defined in

[index.ts:127](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L127)
[index.ts:160](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L160)

___

Expand All @@ -113,7 +136,7 @@ ___

#### Defined in

[index.ts:143](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L143)
[index.ts:176](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L176)

___

Expand All @@ -133,4 +156,4 @@ ___

#### Defined in

[index.ts:123](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L123)
[index.ts:156](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L156)
56 changes: 41 additions & 15 deletions docs/API/classes/LlamaContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

### Methods

- [bench](LlamaContext.md#bench)
- [completion](LlamaContext.md#completion)
- [detokenize](LlamaContext.md#detokenize)
- [embedding](LlamaContext.md#embedding)
Expand All @@ -39,7 +40,7 @@

#### Defined in

[index.ts:49](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L49)
[index.ts:60](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L60)

## Properties

Expand All @@ -49,7 +50,7 @@

#### Defined in

[index.ts:45](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L45)
[index.ts:56](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L56)

___

Expand All @@ -59,7 +60,7 @@ ___

#### Defined in

[index.ts:43](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L43)
[index.ts:54](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L54)

___

Expand All @@ -69,10 +70,33 @@ ___

#### Defined in

[index.ts:47](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L47)
[index.ts:58](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L58)

## Methods

### bench

**bench**(`pp`, `tg`, `pl`, `nr`): `Promise`<[`BenchResult`](../README.md#benchresult)\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `pp` | `number` |
| `tg` | `number` |
| `pl` | `number` |
| `nr` | `number` |

#### Returns

`Promise`<[`BenchResult`](../README.md#benchresult)\>

#### Defined in

[index.ts:129](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L129)

___

### completion

**completion**(`params`, `callback?`): `Promise`<`NativeCompletionResult`\>
Expand All @@ -90,7 +114,7 @@ ___

#### Defined in

[index.ts:73](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L73)
[index.ts:84](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L84)

___

Expand All @@ -110,7 +134,7 @@ ___

#### Defined in

[index.ts:110](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L110)
[index.ts:121](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L121)

___

Expand All @@ -130,13 +154,13 @@ ___

#### Defined in

[index.ts:114](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L114)
[index.ts:125](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L125)

___

### loadSession

**loadSession**(`filepath`): `Promise`<`number`\>
**loadSession**(`filepath`): `Promise`<`NativeSessionLoadResult`\>

Load cached prompt & completion state from a file.

Expand All @@ -148,11 +172,11 @@ Load cached prompt & completion state from a file.

#### Returns

`Promise`<`number`\>
`Promise`<`NativeSessionLoadResult`\>

#### Defined in

[index.ts:62](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L62)
[index.ts:73](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L73)

___

Expand All @@ -166,13 +190,13 @@ ___

#### Defined in

[index.ts:118](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L118)
[index.ts:151](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L151)

___

### saveSession

**saveSession**(`filepath`): `Promise`<`number`\>
**saveSession**(`filepath`, `options?`): `Promise`<`number`\>

Save current cached prompt & completion state to a file.

Expand All @@ -181,14 +205,16 @@ Save current cached prompt & completion state to a file.
| Name | Type |
| :------ | :------ |
| `filepath` | `string` |
| `options?` | `Object` |
| `options.tokenSize` | `number` |

#### Returns

`Promise`<`number`\>

#### Defined in

[index.ts:69](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L69)
[index.ts:80](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L80)

___

Expand All @@ -202,7 +228,7 @@ ___

#### Defined in

[index.ts:102](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L102)
[index.ts:113](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L113)

___

Expand All @@ -222,4 +248,4 @@ ___

#### Defined in

[index.ts:106](https://github.com/mybigday/llama.rn/blob/8738c99/src/index.ts#L106)
[index.ts:117](https://github.com/mybigday/llama.rn/blob/427a856/src/index.ts#L117)
12 changes: 6 additions & 6 deletions docs/API/classes/SchemaGrammarConverter.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#### Defined in

[grammar.ts:39](https://github.com/mybigday/llama.rn/blob/8738c99/src/grammar.ts#L39)
[grammar.ts:39](https://github.com/mybigday/llama.rn/blob/427a856/src/grammar.ts#L39)

## Properties

Expand All @@ -43,7 +43,7 @@

#### Defined in

[grammar.ts:35](https://github.com/mybigday/llama.rn/blob/8738c99/src/grammar.ts#L35)
[grammar.ts:35](https://github.com/mybigday/llama.rn/blob/427a856/src/grammar.ts#L35)

___

Expand All @@ -53,7 +53,7 @@ ___

#### Defined in

[grammar.ts:37](https://github.com/mybigday/llama.rn/blob/8738c99/src/grammar.ts#L37)
[grammar.ts:37](https://github.com/mybigday/llama.rn/blob/427a856/src/grammar.ts#L37)

## Methods

Expand All @@ -74,7 +74,7 @@ ___

#### Defined in

[grammar.ts:45](https://github.com/mybigday/llama.rn/blob/8738c99/src/grammar.ts#L45)
[grammar.ts:45](https://github.com/mybigday/llama.rn/blob/427a856/src/grammar.ts#L45)

___

Expand All @@ -88,7 +88,7 @@ ___

#### Defined in

[grammar.ts:125](https://github.com/mybigday/llama.rn/blob/8738c99/src/grammar.ts#L125)
[grammar.ts:125](https://github.com/mybigday/llama.rn/blob/427a856/src/grammar.ts#L125)

___

Expand All @@ -109,4 +109,4 @@ ___

#### Defined in

[grammar.ts:65](https://github.com/mybigday/llama.rn/blob/8738c99/src/grammar.ts#L65)
[grammar.ts:65](https://github.com/mybigday/llama.rn/blob/427a856/src/grammar.ts#L65)
2 changes: 1 addition & 1 deletion example/src/Bubble.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useContext } from 'react'
import type { ReactNode } from 'react'
import { View, Text, TouchableOpacity } from 'react-native'
import Clipboard from '@react-native-clipboard/clipboard'
import { ThemeContext, UserContext } from '@flyerhq/react-native-chat-ui'
import type { MessageType } from '@flyerhq/react-native-chat-ui'
import Clipboard from '@react-native-clipboard/clipboard';

export const Bubble = ({
child,
Expand Down

0 comments on commit 008a3db

Please sign in to comment.