Skip to content

Commit

Permalink
feat(ts): sync grammar converter (#48)
Browse files Browse the repository at this point in the history
* feat(ts): sync grammar converter

* fix(ts): type issues

* feat(ts): expose options

* feat(ts): sync schema converter

* feat(ts): handle resolve refs in convertJsonSchemaToGrammar
  • Loading branch information
jhen0409 authored Apr 25, 2024
1 parent 0b8f9bb commit 7834a73
Show file tree
Hide file tree
Showing 6 changed files with 1,065 additions and 148 deletions.
22 changes: 12 additions & 10 deletions docs/API/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ llama.rn

#### Defined in

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

___

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

#### Defined in

[index.ts:41](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L41)
[index.ts:41](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L41)

___

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

#### Defined in

[index.ts:39](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L39)
[index.ts:39](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L39)

___

Expand All @@ -80,29 +80,31 @@ ___

#### Defined in

[index.ts:29](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L29)
[index.ts:29](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L29)

## Functions

### convertJsonSchemaToGrammar

**convertJsonSchemaToGrammar**(`«destructured»`): `string`
**convertJsonSchemaToGrammar**(`«destructured»`): `string` \| `Promise`<`string`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `«destructured»` | `Object` |
| › `allowFetch?` | `boolean` |
| › `dotall?` | `boolean` |
| › `propOrder?` | `PropOrder` |
| › `schema` | `any` |

#### Returns

`string`
`string` \| `Promise`<`string`\>

#### Defined in

[grammar.ts:134](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/grammar.ts#L134)
[grammar.ts:824](https://github.com/mybigday/llama.rn/blob/17714d4/src/grammar.ts#L824)

___

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

#### Defined in

[index.ts:160](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L160)
[index.ts:160](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L160)

___

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

#### Defined in

[index.ts:176](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L176)
[index.ts:176](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L176)

___

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

#### Defined in

[index.ts:156](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L156)
[index.ts:156](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L156)
26 changes: 13 additions & 13 deletions docs/API/classes/LlamaContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#### Defined in

[index.ts:60](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L60)
[index.ts:60](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L60)

## Properties

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

#### Defined in

[index.ts:56](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L56)
[index.ts:56](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L56)

___

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

#### Defined in

[index.ts:54](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L54)
[index.ts:54](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L54)

___

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

#### Defined in

[index.ts:58](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L58)
[index.ts:58](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L58)

## Methods

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

#### Defined in

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

___

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

#### Defined in

[index.ts:84](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L84)
[index.ts:84](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L84)

___

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

#### Defined in

[index.ts:121](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L121)
[index.ts:121](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L121)

___

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

#### Defined in

[index.ts:125](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L125)
[index.ts:125](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L125)

___

Expand All @@ -176,7 +176,7 @@ Load cached prompt & completion state from a file.

#### Defined in

[index.ts:73](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L73)
[index.ts:73](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L73)

___

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

#### Defined in

[index.ts:151](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L151)
[index.ts:151](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L151)

___

Expand All @@ -214,7 +214,7 @@ Save current cached prompt & completion state to a file.

#### Defined in

[index.ts:80](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L80)
[index.ts:80](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L80)

___

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

#### Defined in

[index.ts:113](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L113)
[index.ts:113](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L113)

___

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

#### Defined in

[index.ts:117](https://github.com/mybigday/llama.rn/blob/e3e9f86/src/index.ts#L117)
[index.ts:117](https://github.com/mybigday/llama.rn/blob/17714d4/src/index.ts#L117)
Loading

0 comments on commit 7834a73

Please sign in to comment.