From 41db8c8680266bfc70cf51ee87a64db410b48574 Mon Sep 17 00:00:00 2001 From: Jay Mathis Date: Sun, 3 Mar 2024 19:06:47 -0600 Subject: [PATCH] rebuild --- docs/classes/Core.Client.html | 4 +-- docs/classes/Core.Game.html | 32 ++++++++++----------- docs/enums/Core.GameEvent.html | 4 +-- docs/functions/tools.call.html | 2 +- docs/index.html | 2 +- docs/interfaces/tools.Tool.html | 4 +-- docs/modules/Core.html | 2 +- docs/modules/tools.html | 2 +- docs/types/Core.Ability.html | 2 +- docs/types/Core.Character.html | 2 +- docs/types/Core.Chat.html | 2 +- docs/types/Core.ChatMessage.html | 2 +- docs/types/Core.GameClientImageOptions.html | 2 +- docs/types/Core.GameClientOptions.html | 2 +- docs/types/Core.GameData.html | 2 +- docs/types/Core.GameOptions.html | 2 +- docs/types/Core.InventoryItem.html | 2 +- docs/types/Core.Quest.html | 2 +- docs/variables/tools.tools.html | 2 +- 19 files changed, 37 insertions(+), 37 deletions(-) diff --git a/docs/classes/Core.Client.html b/docs/classes/Core.Client.html index 9438cd0..64c6e91 100644 --- a/docs/classes/Core.Client.html +++ b/docs/classes/Core.Client.html @@ -1,4 +1,4 @@ -Client | AIGE

Class Client

Constructors

constructor +Client | AIGE

Class Client

Constructors

Properties

client contextWindow game @@ -7,4 +7,4 @@ tokens

Methods

Constructors

Properties

client: OpenAI
contextWindow: number
game: Game
imageModel: string
model: string
tokens: number = 0

Methods

  • Parameters

    • tool: Tool | Tool[]
    • parameters: CallParameters

    Returns Promise<any>

\ No newline at end of file +

Constructors

Properties

client: OpenAI
contextWindow: number
game: Game
imageModel: string
model: string
tokens: number = 0

Methods

  • Parameters

    • tool: Tool | Tool[]
    • parameters: CallParameters

    Returns Promise<any>

\ No newline at end of file diff --git a/docs/classes/Core.Game.html b/docs/classes/Core.Game.html index e6942ab..5a7c08d 100644 --- a/docs/classes/Core.Game.html +++ b/docs/classes/Core.Game.html @@ -2,7 +2,7 @@ This is the class that you will use to create a game.

Example

const game = new Game({
universe: 'Cyberpunk',
playerName: 'Punk',
playerClass: 'Hacker'
})
-

Constructors

Constructors

Properties

chats client data @@ -24,22 +24,22 @@ on resolvePath set -

Constructors

Properties

chats: Chat[] = []
client: Client
data: GameData = ...
events: EventEmitter = ...
history: (ChatCompletionUserMessageParam | ChatCompletionMessage)[] = []
id: string = ...
options: GameOptions

Accessors

  • get level(): number
  • Calculate the player's level based on their experience

    -

    Returns number

  • get overburdened(): boolean
  • Determine if the player is overburdened

    -

    Returns boolean

  • get weightCarried(): number
  • Calculate the player's weight carried

    -

    Returns number

Methods

  • Commit an action on the game

    +

Constructors

Properties

chats: Chat[] = []
client: Client
data: GameData = ...
events: EventEmitter = ...
history: (ChatCompletionUserMessageParam | ChatCompletionMessage)[] = []
id: string = ...
options: GameOptions

Accessors

  • get level(): number
  • Calculate the player's level based on their experience

    +

    Returns number

  • get overburdened(): boolean
  • Determine if the player is overburdened

    +

    Returns boolean

  • get weightCarried(): number
  • Calculate the player's weight carried

    +

    Returns number

Methods

  • Commit an action on the game

    Parameters

    • action: string

      The action to commit

      -

    Returns Promise<Game>

  • Send a chat message to a character

    +

Returns Promise<Game>

  • Send a chat message to a character

    Listen for game.events.on(GameEvent.chat) to get the response

    Parameters

    • data: {
          character: Character;
          dialog: string;
      }

    Returns Promise<void>

    Todo

    Prune chat history to fit context window

    -
  • Export the game data object

    -

    Returns {
        chats: Chat[];
        data: GameData;
        history: (ChatCompletionUserMessageParam | ChatCompletionMessage)[];
        id: string;
        options: GameOptions;
        tokens: number;
    }

    • chats: Chat[]
    • data: GameData
    • history: (ChatCompletionUserMessageParam | ChatCompletionMessage)[]
    • id: string
    • options: GameOptions
    • tokens: number
  • Create images of various game objects

    +
  • Export the game data object

    +

    Returns {
        chats: Chat[];
        data: GameData;
        history: (ChatCompletionUserMessageParam | ChatCompletionMessage)[];
        id: string;
        options: GameOptions;
        tokens: number;
    }

    • chats: Chat[]
    • data: GameData
    • history: (ChatCompletionUserMessageParam | ChatCompletionMessage)[]
    • id: string
    • options: GameOptions
    • tokens: number
  • Import a game data object

    -

    Parameters

    • data: any

    Returns void

  • Initialize a new game

    -

    Returns Promise<void>

  • Inspect the game data

    -

    Returns string

  • Stop listening for game events

    -

    Parameters

    • event: GameEvent
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Listen for game events

    -

    Parameters

    • event: GameEvent
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Resolve a path in the game data

    -

    Parameters

    • obj: any
    • path: string

    Returns {
        value: any;
    }

    • get value(): any
    • set value(newValue: any): void
  • Manually set a value in the game data

    -

    Parameters

    • key: string
    • value: any

    Returns void

\ No newline at end of file +

Parameters

Returns Promise<{
    ability?: Image;
    character?: Image;
    cover?: Image;
    item?: Image;
    player?: Image;
    scene?: Image;
}>

\ No newline at end of file diff --git a/docs/enums/Core.GameEvent.html b/docs/enums/Core.GameEvent.html index 49c0283..c6a99fc 100644 --- a/docs/enums/Core.GameEvent.html +++ b/docs/enums/Core.GameEvent.html @@ -1,4 +1,4 @@ -GameEvent | AIGE

Enumeration GameEvent

Enumeration Members

ability_added +GameEvent | AIGE

Enumeration GameEvent

Enumeration Members

ability_added: "ability_added"
ability_removed: "ability_removed"
action: "action"
armor_destroyed: "armor_destroyed"
character_added: "character_added"
character_removed: "character_removed"
chat: "chat"
death: "death"
financial_ruin: "financial_ruin"
gain: "gain"
images_created: "images_created"
import: "import"
inventory_added: "inventory_added"
inventory_removed: "inventory_removed"
loss: "loss"
quest_added: "quest_added"
quest_removed: "quest_removed"
\ No newline at end of file +

Enumeration Members

ability_added: "ability_added"
ability_removed: "ability_removed"
action: "action"
armor_destroyed: "armor_destroyed"
character_added: "character_added"
character_removed: "character_removed"
chat: "chat"
death: "death"
financial_ruin: "financial_ruin"
gain: "gain"
images_created: "images_created"
import: "import"
inventory_added: "inventory_added"
inventory_removed: "inventory_removed"
loss: "loss"
quest_added: "quest_added"
quest_removed: "quest_removed"
\ No newline at end of file diff --git a/docs/functions/tools.call.html b/docs/functions/tools.call.html index b76beab..c3d2d16 100644 --- a/docs/functions/tools.call.html +++ b/docs/functions/tools.call.html @@ -1 +1 @@ -call | AIGE

Function call

  • Parameters

    Returns ((parameters) => Promise<any>)

      • (parameters): Promise<any>
      • Parameters

        • parameters: any

        Returns Promise<any>

\ No newline at end of file +call | AIGE

Function call

  • Parameters

    Returns ((parameters) => Promise<any>)

      • (parameters): Promise<any>
      • Parameters

        • parameters: any

        Returns Promise<any>

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 763fd35..b753ed2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,7 +6,7 @@

Made with ❤️ by Jay Mathis

Please consider becoming a sponsor or buying tokens on Imagined.Quest if you appreciate my work.


-

NPM

+

NPM

View Docs Made with TypeScript

Version diff --git a/docs/interfaces/tools.Tool.html b/docs/interfaces/tools.Tool.html index ef841ff..dc9dd6a 100644 --- a/docs/interfaces/tools.Tool.html +++ b/docs/interfaces/tools.Tool.html @@ -1,3 +1,3 @@ -Tool | AIGE

Interface Tool

interface Tool {
    execute: ((parameters) => any);
    schema: ChatCompletionTool;
}

Properties

execute +Tool | AIGE

Interface Tool

interface Tool {
    execute: ((parameters) => any);
    schema: ChatCompletionTool;
}

Properties

Properties

execute: ((parameters) => any)

Type declaration

    • (parameters): any
    • Parameters

      • parameters: any

      Returns any

schema: ChatCompletionTool
\ No newline at end of file +

Properties

execute: ((parameters) => any)

Type declaration

    • (parameters): any
    • Parameters

      • parameters: any

      Returns any

schema: ChatCompletionTool
\ No newline at end of file diff --git a/docs/modules/Core.html b/docs/modules/Core.html index d9d4898..a5dabc9 100644 --- a/docs/modules/Core.html +++ b/docs/modules/Core.html @@ -1,5 +1,5 @@ Core | AIGE

Module Core

Description

This is the main module of the library. It exports all the classes and interfaces needed to create a game.

-

References

References

Enumerations

Classes

Client diff --git a/docs/modules/tools.html b/docs/modules/tools.html index 878f03b..1541481 100644 --- a/docs/modules/tools.html +++ b/docs/modules/tools.html @@ -1,4 +1,4 @@ -tools | AIGE

Module tools

Index

Interfaces

Tool +tools | AIGE

Module tools

Index

Interfaces

Variables

Functions

\ No newline at end of file diff --git a/docs/types/Core.Ability.html b/docs/types/Core.Ability.html index 43365cb..1075414 100644 --- a/docs/types/Core.Ability.html +++ b/docs/types/Core.Ability.html @@ -1 +1 @@ -Ability | AIGE

Type alias Ability

Ability: {
    description: string;
    emoji: string;
    name: string;
}

Type declaration

  • description: string
  • emoji: string
  • name: string
\ No newline at end of file +Ability | AIGE

Type alias Ability

Ability: {
    description: string;
    emoji: string;
    name: string;
}

Type declaration

  • description: string
  • emoji: string
  • name: string
\ No newline at end of file diff --git a/docs/types/Core.Character.html b/docs/types/Core.Character.html index ac05d72..8edb9a3 100644 --- a/docs/types/Core.Character.html +++ b/docs/types/Core.Character.html @@ -1 +1 @@ -Character | AIGE

Type alias Character

Character: {
    abilities: Ability[];
    alive: boolean;
    appearance: string;
    armor: number;
    description: string;
    emoji: string;
    health: number;
    health_description: string;
    hostile: boolean;
    inventory: InventoryItem[];
    money: number;
    name: string;
    reputation: number;
    reputation_description: string;
}

Type declaration

  • abilities: Ability[]
  • alive: boolean
  • appearance: string
  • armor: number
  • description: string
  • emoji: string
  • health: number
  • health_description: string
  • hostile: boolean
  • inventory: InventoryItem[]
  • money: number
  • name: string
  • reputation: number
  • reputation_description: string
\ No newline at end of file +Character | AIGE

Type alias Character

Character: {
    abilities: Ability[];
    alive: boolean;
    appearance: string;
    armor: number;
    description: string;
    emoji: string;
    health: number;
    health_description: string;
    hostile: boolean;
    inventory: InventoryItem[];
    money: number;
    name: string;
    reputation: number;
    reputation_description: string;
}

Type declaration

  • abilities: Ability[]
  • alive: boolean
  • appearance: string
  • armor: number
  • description: string
  • emoji: string
  • health: number
  • health_description: string
  • hostile: boolean
  • inventory: InventoryItem[]
  • money: number
  • name: string
  • reputation: number
  • reputation_description: string
\ No newline at end of file diff --git a/docs/types/Core.Chat.html b/docs/types/Core.Chat.html index cecbc9c..2cdd345 100644 --- a/docs/types/Core.Chat.html +++ b/docs/types/Core.Chat.html @@ -1 +1 @@ -Chat | AIGE

Type alias Chat

Chat: {
    character_name: string;
    messages: [ChatMessage];
}

Type declaration

\ No newline at end of file +Chat | AIGE

Type alias Chat

Chat: {
    character_name: string;
    messages: [ChatMessage];
}

Type declaration

\ No newline at end of file diff --git a/docs/types/Core.ChatMessage.html b/docs/types/Core.ChatMessage.html index 2560f96..84ebd89 100644 --- a/docs/types/Core.ChatMessage.html +++ b/docs/types/Core.ChatMessage.html @@ -1 +1 @@ -ChatMessage | AIGE

Type alias ChatMessage

ChatMessage: {
    content: string;
    from_player: boolean;
    timestamp: string;
}

Type declaration

  • content: string
  • from_player: boolean
  • timestamp: string
\ No newline at end of file +ChatMessage | AIGE

Type alias ChatMessage

ChatMessage: {
    content: string;
    from_player: boolean;
    timestamp: string;
}

Type declaration

  • content: string
  • from_player: boolean
  • timestamp: string
\ No newline at end of file diff --git a/docs/types/Core.GameClientImageOptions.html b/docs/types/Core.GameClientImageOptions.html index b12901d..fe4d9cc 100644 --- a/docs/types/Core.GameClientImageOptions.html +++ b/docs/types/Core.GameClientImageOptions.html @@ -1 +1 @@ -GameClientImageOptions | AIGE

Type alias GameClientImageOptions

GameClientImageOptions: {
    model?: string;
    quality?: string;
    response_format?: string;
    size?: string;
    style?: string;
    user?: string;
}

Type declaration

  • Optional model?: string
  • Optional quality?: string
  • Optional response_format?: string
  • Optional size?: string
  • Optional style?: string
  • Optional user?: string
\ No newline at end of file +GameClientImageOptions | AIGE

Type alias GameClientImageOptions

GameClientImageOptions: {
    model?: string;
    quality?: string;
    response_format?: string;
    size?: string;
    style?: string;
    user?: string;
}

Type declaration

  • Optional model?: string
  • Optional quality?: string
  • Optional response_format?: string
  • Optional size?: string
  • Optional style?: string
  • Optional user?: string
\ No newline at end of file diff --git a/docs/types/Core.GameClientOptions.html b/docs/types/Core.GameClientOptions.html index c4046e5..4c1e768 100644 --- a/docs/types/Core.GameClientOptions.html +++ b/docs/types/Core.GameClientOptions.html @@ -1 +1 @@ -GameClientOptions | AIGE

Type alias GameClientOptions

GameClientOptions: {
    clientOptions?: ClientOptions;
    contextWindow?: number;
    imageModel?: string;
    model?: string;
}

Type declaration

  • Optional clientOptions?: ClientOptions
  • Optional contextWindow?: number
  • Optional imageModel?: string
  • Optional model?: string
\ No newline at end of file +GameClientOptions | AIGE

Type alias GameClientOptions

GameClientOptions: {
    clientOptions?: ClientOptions;
    contextWindow?: number;
    imageModel?: string;
    model?: string;
}

Type declaration

  • Optional clientOptions?: ClientOptions
  • Optional contextWindow?: number
  • Optional imageModel?: string
  • Optional model?: string
\ No newline at end of file diff --git a/docs/types/Core.GameData.html b/docs/types/Core.GameData.html index 3b9432d..3e69d32 100644 --- a/docs/types/Core.GameData.html +++ b/docs/types/Core.GameData.html @@ -1,2 +1,2 @@ GameData | AIGE

Type alias GameData

GameData: {
    abilities?: Ability[];
    actions?: string[];
    appearance?: string;
    armor: number;
    characters?: Character[];
    chats?: Chat[];
    experience: number;
    health: number;
    health_description: string;
    inventory?: InventoryItem[];
    location?: string;
    location_description?: string;
    money: number;
    money_name: string;
    quests?: Quest[];
    reputation: number;
    reputation_description: string;
    rumor?: string;
    scene?: string;
    scene_emoji?: string;
    weather?: string;
    weather_description?: string;
    weight_capacity: number;
    weight_unit: string;
    [key: string]: any;
}

The data of a game

-

Type declaration

  • [key: string]: any
  • Optional abilities?: Ability[]
  • Optional actions?: string[]
  • Optional appearance?: string
  • armor: number
  • Optional characters?: Character[]
  • Optional chats?: Chat[]
  • experience: number
  • health: number
  • health_description: string
  • Optional inventory?: InventoryItem[]
  • Optional location?: string
  • Optional location_description?: string
  • money: number
  • money_name: string
  • Optional quests?: Quest[]
  • reputation: number
  • reputation_description: string
  • Optional rumor?: string
  • Optional scene?: string
  • Optional scene_emoji?: string
  • Optional weather?: string
  • Optional weather_description?: string
  • weight_capacity: number
  • weight_unit: string
\ No newline at end of file +

Type declaration

  • [key: string]: any
  • Optional abilities?: Ability[]
  • Optional actions?: string[]
  • Optional appearance?: string
  • armor: number
  • Optional characters?: Character[]
  • Optional chats?: Chat[]
  • experience: number
  • health: number
  • health_description: string
  • Optional inventory?: InventoryItem[]
  • Optional location?: string
  • Optional location_description?: string
  • money: number
  • money_name: string
  • Optional quests?: Quest[]
  • reputation: number
  • reputation_description: string
  • Optional rumor?: string
  • Optional scene?: string
  • Optional scene_emoji?: string
  • Optional weather?: string
  • Optional weather_description?: string
  • weight_capacity: number
  • weight_unit: string
\ No newline at end of file diff --git a/docs/types/Core.GameOptions.html b/docs/types/Core.GameOptions.html index 2b61fcd..878eb15 100644 --- a/docs/types/Core.GameOptions.html +++ b/docs/types/Core.GameOptions.html @@ -1,2 +1,2 @@ GameOptions | AIGE

Type alias GameOptions

GameOptions: {
    clientOptions?: GameClientOptions;
    language?: string;
    playerClass?: string;
    playerName?: string;
    prompts?: {
        class?: string;
        create?: string;
        name?: string;
        quest?: string;
        summarize?: string;
    };
    universe?: string;
    [key: string]: any;
}

The options of a game

-

Type declaration

  • [key: string]: any
  • Optional clientOptions?: GameClientOptions
  • Optional language?: string
  • Optional playerClass?: string
  • Optional playerName?: string
  • Optional prompts?: {
        class?: string;
        create?: string;
        name?: string;
        quest?: string;
        summarize?: string;
    }
    • Optional class?: string
    • Optional create?: string
    • Optional name?: string
    • Optional quest?: string
    • Optional summarize?: string
  • Optional universe?: string
\ No newline at end of file +

Type declaration

  • [key: string]: any
  • Optional clientOptions?: GameClientOptions
  • Optional language?: string
  • Optional playerClass?: string
  • Optional playerName?: string
  • Optional prompts?: {
        class?: string;
        create?: string;
        name?: string;
        quest?: string;
        summarize?: string;
    }
    • Optional class?: string
    • Optional create?: string
    • Optional name?: string
    • Optional quest?: string
    • Optional summarize?: string
  • Optional universe?: string
\ No newline at end of file diff --git a/docs/types/Core.InventoryItem.html b/docs/types/Core.InventoryItem.html index 4a4660d..e0b7363 100644 --- a/docs/types/Core.InventoryItem.html +++ b/docs/types/Core.InventoryItem.html @@ -1 +1 @@ -InventoryItem | AIGE

Type alias InventoryItem

InventoryItem: {
    consumable: boolean;
    description: string;
    emoji: string;
    name: string;
    rarity: number;
    type: string;
    value: number;
    weight: number;
}

Type declaration

  • consumable: boolean
  • description: string
  • emoji: string
  • name: string
  • rarity: number
  • type: string
  • value: number
  • weight: number
\ No newline at end of file +InventoryItem | AIGE

Type alias InventoryItem

InventoryItem: {
    consumable: boolean;
    description: string;
    emoji: string;
    name: string;
    rarity: number;
    type: string;
    value: number;
    weight: number;
}

Type declaration

  • consumable: boolean
  • description: string
  • emoji: string
  • name: string
  • rarity: number
  • type: string
  • value: number
  • weight: number
\ No newline at end of file diff --git a/docs/types/Core.Quest.html b/docs/types/Core.Quest.html index 5a14250..016c254 100644 --- a/docs/types/Core.Quest.html +++ b/docs/types/Core.Quest.html @@ -1 +1 @@ -Quest | AIGE

Type alias Quest

Quest: {
    completed: boolean;
    description: string;
    emoji: string;
    name: string;
    reward: {
        experience: number;
        inventory: InventoryItem[];
        money: number;
        reputation: number;
    };
}

Type declaration

  • completed: boolean
  • description: string
  • emoji: string
  • name: string
  • reward: {
        experience: number;
        inventory: InventoryItem[];
        money: number;
        reputation: number;
    }
    • experience: number
    • inventory: InventoryItem[]
    • money: number
    • reputation: number
\ No newline at end of file +Quest | AIGE

Type alias Quest

Quest: {
    completed: boolean;
    description: string;
    emoji: string;
    name: string;
    reward: {
        experience: number;
        inventory: InventoryItem[];
        money: number;
        reputation: number;
    };
}

Type declaration

  • completed: boolean
  • description: string
  • emoji: string
  • name: string
  • reward: {
        experience: number;
        inventory: InventoryItem[];
        money: number;
        reputation: number;
    }
    • experience: number
    • inventory: InventoryItem[]
    • money: number
    • reputation: number
\ No newline at end of file diff --git a/docs/variables/tools.tools.html b/docs/variables/tools.tools.html index daa3e03..99a356e 100644 --- a/docs/variables/tools.tools.html +++ b/docs/variables/tools.tools.html @@ -1 +1 @@ -tools | AIGE

Variable toolsConst

tools: {
    action: Tool;
    chat: Tool;
    class: Tool;
    create: Tool;
    inventory: Tool;
    name: Tool;
    reputation: Tool;
    summarize: Tool;
} = ...

Type declaration

\ No newline at end of file +tools | AIGE

Variable toolsConst

tools: {
    action: Tool;
    chat: Tool;
    class: Tool;
    create: Tool;
    inventory: Tool;
    name: Tool;
    reputation: Tool;
    summarize: Tool;
} = ...

Type declaration

\ No newline at end of file