-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export utils and templates, fix tests
- Loading branch information
Showing
15 changed files
with
402 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
id: "parseJSONObjectFromText" | ||
title: "Function: parseJSONObjectFromText" | ||
sidebar_label: "parseJSONObjectFromText" | ||
sidebar_position: 0 | ||
custom_edit_url: null | ||
--- | ||
|
||
▸ **parseJSONObjectFromText**(`text`): `any` | ||
|
||
Parses a JSON object from a given text. The function looks for a JSON block wrapped in triple backticks | ||
with `json` language identifier, and if not found, it searches for an object pattern within the text. | ||
It then attempts to parse the JSON string into a JavaScript object. If parsing is successful and the result | ||
is an object (but not an array), it returns the object; otherwise, it tries to parse an array if the result | ||
is an array, or returns null if parsing is unsuccessful or the result is neither an object nor an array. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `text` | `string` | The input text from which to extract and parse the JSON object. | | ||
|
||
#### Returns | ||
|
||
`any` | ||
|
||
An object parsed from the JSON string if successful; otherwise, null or the result of parsing an array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
id: "parseJsonArrayFromText" | ||
title: "Function: parseJsonArrayFromText" | ||
sidebar_label: "parseJsonArrayFromText" | ||
sidebar_position: 0 | ||
custom_edit_url: null | ||
--- | ||
|
||
▸ **parseJsonArrayFromText**(`text`): ``null`` \| `any`[] | ||
|
||
Parses a JSON array from a given text. The function looks for a JSON block wrapped in triple backticks | ||
with `json` language identifier, and if not found, it searches for an array pattern within the text. | ||
It then attempts to parse the JSON string into a JavaScript object. If parsing is successful and the result | ||
is an array, it returns the array; otherwise, it returns null. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `text` | `string` | The input text from which to extract and parse the JSON array. | | ||
|
||
#### Returns | ||
|
||
``null`` \| `any`[] | ||
|
||
An array parsed from the JSON string if successful; otherwise, null. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
id: "Relationship" | ||
title: "Interface: Relationship" | ||
sidebar_label: "Relationship" | ||
sidebar_position: 0 | ||
custom_edit_url: null | ||
--- | ||
|
||
Represents a relationship between two users, including their IDs, the status of the relationship, and the room ID in which the relationship is established. | ||
|
||
## Properties | ||
|
||
### created\_at | ||
|
||
• `Optional` **created\_at**: `string` | ||
|
||
___ | ||
|
||
### id | ||
|
||
• **id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | ||
|
||
___ | ||
|
||
### room\_id | ||
|
||
• **room\_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | ||
|
||
___ | ||
|
||
### status | ||
|
||
• **status**: `string` | ||
|
||
___ | ||
|
||
### user\_a | ||
|
||
• **user\_a**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | ||
|
||
___ | ||
|
||
### user\_b | ||
|
||
• **user\_b**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | ||
|
||
___ | ||
|
||
### user\_id | ||
|
||
• **user\_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
id: "messageHandlerTemplate" | ||
title: "Variable: messageHandlerTemplate" | ||
sidebar_label: "messageHandlerTemplate" | ||
sidebar_position: 0 | ||
custom_edit_url: null | ||
--- | ||
|
||
• `Const` **messageHandlerTemplate**: ``"{{actionExamples}}\n\n# IMPORTANT: DO NOT USE THE INFORMATION FROM THE EXAMPLES ABOVE. THE EXAMPLES ARE FOR REFERENCE ONLY.\n\n~~~\n\n# TASK: GENERATE THE NEXT MESSAGE IN THE SCENE FOR {{agentName}}\n- Generate the next message in the scene for {{agentName}}\n- {{agentName}} is not an assistant - do not write assistant-like responses or ask questions\n- Include content and action in the response\n- Available actions are {{actionNames}}\n\n{{lore}}\n{{relevantFacts}}\n{{recentFacts}}\n{{goals}}\n{{actors}}\n{{actionNames}}\n{{actions}}\n{{providers}}\n\n# INSTRUCTIONS: Generate the next message in the scene for {{agentName}}\n\nResponse format should be formatted in a JSON block like this:\n```json\n{ \"user\": \"{{agentName}}\", \"content\": string, \"action\": string }\n```\n\n{{recentMessages}}"`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.