Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1294 commits
Select commit Hold shift + click to select a range
e943a2a
Rebuild dc wasm
Jun 19, 2022
4098773
Add missing return
Jun 19, 2022
1b07dee
Rebuild dc wasm
Jun 19, 2022
9a178fa
Apply setRange to all workers in dc worker manager
Jun 19, 2022
4941967
Refactor lod.js api
Jun 19, 2022
1e15efd
Procgen manager api refactoring
Jun 19, 2022
1508727
Procgen manager add trackers tracking
Jun 19, 2022
18a9e61
Procgen manager setRange passthrough
Jun 19, 2022
4780f54
Clean up lod.js dispose chunk logic
Jun 19, 2022
08e0143
Mob manager api update
Jun 19, 2022
9a929ad
Procgen manager api update
Jun 19, 2022
a8463a2
Rebuild dc wasm
Jun 19, 2022
424ceac
Update range API to use Box3
Jun 19, 2022
3ee949a
Add setRange support
Jun 19, 2022
97f59e9
Rebuild dc wasm
Jun 19, 2022
c7ccfee
Extract light-mapper.js
Jun 20, 2022
487b898
Add getLightMapper method to procgen manager
Jun 20, 2022
606c8ac
delete readme
arya3d Jun 20, 2022
1b6fc96
Logging cleanup
Jun 20, 2022
073c09b
Merge branch 'z-targeting' of https://github.com/webaverse/app into z…
arya3d Jun 20, 2022
ae43408
Implicit range tracking in procgen manager instance getter
Jun 20, 2022
dc735c5
Merge branch 'z-targeting' of https://github.com/webaverse/app into z…
arya3d Jun 20, 2022
e174dcc
Extract heightfield mapper
Jun 20, 2022
c2d2251
Add get heightfield mapper method in procgen manager
Jun 20, 2022
c787c62
Merge branch 'z-targeting' of https://github.com/webaverse/app into z…
arya3d Jun 20, 2022
07e720d
Heightfield mapper track coords
Jun 20, 2022
8384c95
More major heightfield mapper integration work
Jun 20, 2022
3c8f4e1
Dead code cleanup
Jun 20, 2022
3a9fb5a
Procgen manager range passthrough support
Jun 20, 2022
3bf21fd
adding instance to injection function parameters
arya3d Jun 20, 2022
7a65a39
comment log in injection function
arya3d Jun 20, 2022
71ca5d2
Merge branch 'z-targeting' of https://github.com/webaverse/app into z…
arya3d Jun 20, 2022
8a78f11
New coord emit api
Jun 20, 2022
2f022fa
Merge branch 'z-targeting' of github.com:webaverse/app into z-targeting
Jun 20, 2022
6cb3b46
Add name to spawner
Jun 20, 2022
95f1643
Initial spawner range support
Jun 20, 2022
55ac6a4
Rewrite mob logic to support ranges
Jun 20, 2022
6f5796b
Parameterize num workers in dc/physics worker managers
Jun 20, 2022
37d0082
Add land metaverse module
Jun 21, 2022
296b5c9
Bugfix spawner metaverse module cleanup
Jun 21, 2022
bbe4f04
Path land metaverse module subapp urls to point to github pages
Jun 21, 2022
22af40a
Add land to street
Jun 21, 2022
2555242
Add missing slashes to urls to fix loading land
Jun 21, 2022
5c76b88
Bugfix engione worker function encode wrapping
Jun 21, 2022
4ab1e7f
Rewriting offscreen engine initialization to pass down port instead o…
Jun 21, 2022
956edbf
Add wait component support to land module
Jun 21, 2022
78c6f2f
Physx worker manager wait for load
Jun 21, 2022
ebea28b
Add land-screenshotter.js
Jun 21, 2022
f12d83f
Add land-iconer.js
Jun 21, 2022
adc74e8
Hook in land page render path
Jun 21, 2022
af38084
Wait for physx in land iconer
Jun 21, 2022
5d12b0f
Land screenshotter capture parameters tweaking
Jun 21, 2022
5d16a1d
Add lod tracker waitUntil support with update event
Jun 21, 2022
95cffa1
Land rendering canvas cleanup
Jun 21, 2022
e5b00bd
Add mobber wait for update support
Jun 21, 2022
84411d6
Update DC apis to support liquids
Jun 22, 2022
7520fe4
Rebuild dc wasm
Jun 22, 2022
c3f58cf
Light mapper emit update events
Jun 22, 2022
16984bc
Rebuild dc wasm
Jun 22, 2022
4bbae03
add lock to dc-worker-manager
arya3d Jun 22, 2022
4b9b4ba
Merge branch 'z-targeting' of https://github.com/webaverse/app into z…
arya3d Jun 22, 2022
44aad35
add locks
arya3d Jun 22, 2022
0ebd2fe
add lock to sphere damage erase func
arya3d Jun 22, 2022
4776007
fix chunk id for lock in dc-worker-manager.js
arya3d Jun 22, 2022
6b44bc5
add chunkId creator func to utils.js
arya3d Jun 22, 2022
bbc9b37
Rebuild dc wasm
Jun 22, 2022
db64120
Merge branch 'z-targeting' of github.com:webaverse/app into z-targeting
Jun 22, 2022
fc39e92
Dead code cleanup
Jun 22, 2022
6365f4a
Add missing biomesWeights terrain passthrough
Jun 22, 2022
10c9f3a
Re-add missing lighting computations deleted with bad merge
Jun 22, 2022
e38aefc
Dc worker locking cleanup
Jun 22, 2022
84645e9
Add new lock manager
Jun 23, 2022
316947c
Use lock manager for locks in dc worker manager
Jun 23, 2022
9090ee1
Lock manager cleanup
Jun 23, 2022
0299a53
Lock manager timing cleanup
Jun 23, 2022
fd12b1d
Rebuild dc wasm
Jun 23, 2022
da33082
Make lock manager local to dc-worker-manager
Jun 23, 2022
3fd30f4
Remove global lock manager
Jun 23, 2022
6a9008c
Hook in new clip range api
Jun 23, 2022
05261cc
Rebuild dc wasm
Jun 23, 2022
7a439fa
Update clip range
Jun 23, 2022
a40ac02
Add procgen manager comment
Jun 23, 2022
a0bcc86
Bugfix heightfield mapper initialization condition
Jun 23, 2022
dc4ee6b
Update land screenshotter params
Jun 23, 2022
1db0d5b
Update land screenshotter clear alpha
Jun 23, 2022
855fecf
Land constants tweaking
Jun 23, 2022
c388838
Land render pixel ratio
Jun 23, 2022
8adbe6f
More constants tweaking
Jun 23, 2022
57d7d2f
Land render cleanup
Jun 23, 2022
d8f094c
Add chunk lod property
Jun 23, 2022
b0a4165
Use new heightfield methods
Jun 24, 2022
0b2e691
Rebuild dc wasm
Jun 24, 2022
6ab3bb7
Rebuild dc wasm
Jun 24, 2022
99fc9fa
Bugfix offscreen engine iframe SharedArrayBuffer
Jun 25, 2022
3b24822
Small cleanup
Jun 25, 2022
3017e71
Use numThreads in dc worker manager
Jun 27, 2022
bf68c5b
Rebuild dc wasm
Jun 27, 2022
c5c858c
New async dc workers support
Jun 27, 2022
5e49b38
Small cleanup
Jun 27, 2022
77bc9cc
Comment out initial land rendering
Jun 27, 2022
e91128c
Add relod solution
Jun 27, 2022
0aededb
Clean up thread count
Jun 27, 2022
c614acd
Update initialization
Jun 27, 2022
f1f2169
Add new DC build files
Jun 27, 2022
d5c2a83
Remove dead dc.ww.js
Jun 27, 2022
145413a
Update DC calls to async versions
Jun 27, 2022
db34b2e
Rebuild DC wasm
Jun 27, 2022
870c16c
Rebuild
Jun 27, 2022
ac1b09f
Rebuild dc wasm
Jun 28, 2022
6a116eb
Rebuild dc wasm
Jun 28, 2022
d7d263e
added convai api endpoint
crazylazylife Jun 29, 2022
1fbe3ea
Comment out dc worke ports init
Jun 30, 2022
6863340
Remove lock in dc worker manager
Jun 30, 2022
e9af669
More lock removal
Jun 30, 2022
defe0bd
Dc worker parallelization unlock
Jun 30, 2022
260be41
Rebuild dc wasm
Jun 30, 2022
6266082
Bugfix bc delete in dual-contouring.js
Jun 30, 2022
4bfcf53
2x work in lod manager
Jun 30, 2022
4597ba0
Add chunk debug mesh support to lod.js
Jun 30, 2022
5b41ee2
Debug constant initialization
Jun 30, 2022
e6d3552
Bugfix lod trackY
Jun 30, 2022
8414e24
Use allocatorless dc binding
Jul 1, 2022
6044902
Rebuild dc
Jul 1, 2022
e8109bd
Bugfix ImmediateGLBufferAttribute initial binding
Jul 2, 2022
e4e0597
Update heightfield mapper texturing
Jul 2, 2022
f156e42
removing lock from draw sphere damage
arya3d Jul 2, 2022
a426305
Bugfix localVector position aliasing when generating lights
Jul 2, 2022
63a7525
Merge branch 'z-targeting' of github.com:webaverse/app into z-targeting
Jul 2, 2022
5ed3bab
Remove dead try-catches
Jul 2, 2022
aafdcad
Rebuild dc wasm
Jul 2, 2022
85dc342
Small dead code cleanup
Jul 2, 2022
6a34260
Add light mapper debug mesh support
Jul 2, 2022
870b01d
Lod tracker do not latch debug flag
Jul 2, 2022
397721c
Lod tracker emits order refactoring
Jul 2, 2022
ed58dcb
Light mapper emits refactoring
Jul 2, 2022
f028f9c
Rebuild dc wasm
Jul 2, 2022
d1a4d30
Rebuild dc wasm
Jul 2, 2022
b3d1173
Bugfix lod2 math
Jul 2, 2022
c51b293
Rebuild dc wasm
Jul 2, 2022
c8d945b
Add new DC result handler
Jul 2, 2022
db8c705
Merge pull request #3178 from Conv-AI/convai-api-integration
lalalune Jul 3, 2022
5679514
removing injection calls from dc-worker.js
arya3d Jul 3, 2022
f27f02a
adjusting terrain hit api
arya3d Jul 3, 2022
186fffb
remove hit log from dual-contouring.js
arya3d Jul 3, 2022
783e0ce
Comment out dead damage injection
Jul 3, 2022
27c8ece
Add align functions
Jul 3, 2022
ab35139
Commenting cleanup
Jul 3, 2022
ed1988b
Add biome uvs + lights parsing
Jul 3, 2022
210cec8
Rebuild dc wasm
Jul 3, 2022
d073d58
Merge branch 'z-targeting' of github.com:webaverse/app into z-targeting
Jul 3, 2022
04cd887
New biomes uvs instead of texture
Jul 4, 2022
24a8655
Hook in new task cancel APIs
Jul 4, 2022
3c51056
Rebuild dc wasm
Jul 4, 2022
17beda6
Use flat lod1 for closest lod
Jul 4, 2022
80fe024
Debug cleanup
Jul 4, 2022
686a1ac
New task based lods
Jul 5, 2022
b5ad284
Lod algorithm checkpoint
Jul 5, 2022
a64c879
Octree diff sampling
Jul 5, 2022
be3a6ed
Relod debugging
Jul 6, 2022
e3fa44b
Lods debug mesh
Jul 6, 2022
20bccb2
Get node cleanup in octree gen
Jul 6, 2022
d543941
Bugfix leaf position offset
Jul 6, 2022
de39eb8
Dead code cleanup
Jul 6, 2022
fbf2595
Abstract lod positions update
Jul 6, 2022
b50bd0d
Update lods task manager
Jul 6, 2022
7bcb25e
Add intersectNode method
Jul 6, 2022
9e838ca
Add more nodes tracking methods
Jul 6, 2022
6386524
New tasks system handling
Jul 6, 2022
8a54977
Log cleanup
Jul 6, 2022
cc27899
More logging cleanup
Jul 6, 2022
44f6a26
Task lookup cleanup
Jul 6, 2022
563e30f
Localize tasks tracking in lod.js
Jul 7, 2022
0a54cb7
Bugfix liveTasks reference
Jul 7, 2022
902471e
Update land iconer parameters
Jul 7, 2022
a51de5f
Dead code cleanup
Jul 7, 2022
f60cee7
More dead code cleanup
Jul 7, 2022
6d0df44
Comments cleanup
Jul 7, 2022
bf1e156
Add Task commit + waitForLoad methods
Jul 7, 2022
53f562e
Rewrite lods components handling
Jul 7, 2022
6d24447
Rewrite lod.js components handling
Jul 7, 2022
3ede28a
Update equipment panel rendering
Jul 7, 2022
66d3467
Disable map music in map gen jsx
Jul 7, 2022
dd03b6e
Redefine voxelPixelSize
Jul 7, 2022
53c8f9b
Use new terrain system in map
Jul 7, 2022
03ba528
Bracked out map gen hacks
Jul 7, 2022
33e7d74
Abstract physics manager into physics scene
Jul 8, 2022
483a6f8
Update metaversefile physics manager api
Jul 8, 2022
83d7e2c
Port physics scene users to new api
Jul 8, 2022
b5aec3b
Rebuild dc wasm
Jul 8, 2022
4b9f660
More physics manager port work
Jul 8, 2022
19c8008
Lod tracker chunks passthrough
Jul 8, 2022
f73d921
Physics manager load promise cleanup
Jul 8, 2022
f63db7e
Logging cleanup
Jul 8, 2022
d931136
More physics scene debugging
Jul 8, 2022
5cfa4ca
Add physicsInstance flag support
Jul 8, 2022
9203eed
Dead code cleanup in src/
Jul 8, 2022
6feef36
Logging cleanup
Jul 8, 2022
badc5c1
Rebuild physx wasm
Jul 8, 2022
82982aa
Hook in new base physics api
Jul 8, 2022
3c675ed
Clean up lods on map screen
Jul 8, 2022
a925e46
IO manager args cleanup
Jul 8, 2022
8c27952
MapGen parcel highlight
Jul 8, 2022
644ebe1
Physx worker lite bugfixing
Jul 8, 2022
e8046e9
Bugfix land syntax
Jul 8, 2022
a03194d
Bugfix land syntax
Jul 8, 2022
22ffdeb
Merge branch 'lodz' into z-targeting
Jul 8, 2022
6392a51
Fix typo
Jul 8, 2022
f5c68ed
Fix typo again
Jul 8, 2022
87a628e
Rebuild dc wasm
Jul 8, 2022
df57c0e
Rebuild dc wasm
Jul 8, 2022
2c6f20d
Add land app getChunkForPhysicsObject method support
Jul 9, 2022
5b224fd
Major map work
Jul 9, 2022
06a6146
Map debugging checkpoint
Jul 9, 2022
d3a814b
New forward target logic
Jul 9, 2022
3328377
Map key handling
Jul 9, 2022
f043c1c
Add select hover
Jul 9, 2022
ce0afbb
More chunk highlight cleanup
Jul 9, 2022
9c07648
Add map deselect support
Jul 9, 2022
3624057
Add IoHandler dblclick support
Jul 9, 2022
a327324
Add map select dblclick
Jul 9, 2022
857e1b4
New map animation logic
Jul 9, 2022
ac582fd
Rebuild dc wasm
Jul 9, 2022
89f66bc
Add components update passthrough in land app
Jul 9, 2022
630c893
Rebuild dc wasm
Jul 9, 2022
d5f96c6
Lod tracking cleanup
Jul 9, 2022
9d30c5e
Lod checkpoint
Jul 9, 2022
504317d
Clean up map positioning
Jul 9, 2022
b5a1b15
Dead code cleanup in lod.js
Jul 9, 2022
028bc4c
Update chunks tracking in lod.js
Jul 9, 2022
eb3d359
More lod.js cleanup
Jul 9, 2022
13b1261
Cleanup in lod.js
Jul 9, 2022
b206965
Bugfix lod.js destroy
Jul 9, 2022
17580da
Rebuild dc wasm
Jul 9, 2022
32b3b39
Add animation interrupt
Jul 9, 2022
46e9e36
Simplify tracking of leaf nodes in lods.js
Jul 9, 2022
72ca9ca
fix null error if player clicks while app is loading
lalalune Jul 8, 2022
10ddb2b
patch fix riding on mounts like the dragon
lalalune Jul 8, 2022
95b0197
Move multiplayer room handling to universe.js and make world a proper…
lalalune Jul 10, 2022
6b3ae98
Remove invalid call to updateAvatar on remote players
lalalune Jul 5, 2022
6cd1728
Merge pull request #3220 from webaverse/fix-selectaxiswithraycaster-2
Jul 12, 2022
29e8497
Merge pull request #3221 from webaverse/patch-fix-rigged-mounts-2
Jul 12, 2022
2c6cf15
Merge pull request #3227 from webaverse/remove-update-remoteplayers-2
Jul 12, 2022
ad3a99d
Merge pull request #3223 from webaverse/z-world-universe-2
Jul 12, 2022
9d46030
Add tracker methods
Jul 12, 2022
be77ceb
More create tracker bindings
Jul 12, 2022
9c3b1d2
Tracker native bindings
Jul 12, 2022
20b82c0
Dead code cleanup
Jul 12, 2022
294312c
Merge branch 'z-targeting' of github.com:webaverse/app into z-targeting
Jul 12, 2022
23eec60
Patch lore model to public instance
Jul 12, 2022
f032758
Remove land from street.scn
Jul 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions ImmediateGLBufferAttribute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import * as THREE from 'three';
import {getRenderer} from './renderer.js';

export class ImmediateGLBufferAttribute extends THREE.GLBufferAttribute {
constructor(array, itemSize, isIndex = false) {
const Type = array.constructor;
let glType;
switch (Type) {
case Float32Array: {
glType = WebGLRenderingContext.FLOAT;
break;
}
case Uint16Array: {
glType = WebGLRenderingContext.UNSIGNED_SHORT;
break;
}
case Int16Array: {
glType = WebGLRenderingContext.SHORT;
break;
}
case Uint32Array: {
glType = WebGLRenderingContext.UNSIGNED_INT;
break;
}
case Int32Array: {
glType = WebGLRenderingContext.INT;
break;
}
case Uint8Array: {
glType = WebGLRenderingContext.UNSIGNED_BYTE;
break;
}
case Int8Array: {
glType = WebGLRenderingContext.BYTE;
break;
}
default: {
throw new Error(`Unsupported array type: ${Type}`);
}
}
const renderer = getRenderer();
const gl = renderer.getContext();
const buffer = gl.createBuffer();
{
const target = ImmediateGLBufferAttribute.getTarget(isIndex);
const oldBinding = gl.getParameter(ImmediateGLBufferAttribute.getTargetBinding(isIndex));
gl.bindBuffer(target, buffer);
gl.bufferData(target, array.byteLength, gl.DYNAMIC_DRAW);
gl.bindBuffer(target, oldBinding);
}
super(buffer, glType, itemSize, Type.BYTES_PER_ELEMENT, array.length / itemSize);

this.array = array;
this.isIndex = isIndex;
/* this.updateRange = {
offset: 0,
count: -1,
}; */
}
static getTarget(isIndex) {
return isIndex ? WebGLRenderingContext.ELEMENT_ARRAY_BUFFER : WebGLRenderingContext.ARRAY_BUFFER;
}
getTarget() {
return ImmediateGLBufferAttribute.getTarget(this.isIndex);
}
static getTargetBinding(isIndex) {
return isIndex ? WebGLRenderingContext.ELEMENT_ARRAY_BUFFER_BINDING : WebGLRenderingContext.ARRAY_BUFFER_BINDING;
}
getTargetBinding() {
return ImmediateGLBufferAttribute.getTargetBinding(this.isIndex);
}
pushed = false;
static pushUpdate() {
const renderer = getRenderer();
const gl = renderer.getContext();

const arrayBufferBinding = gl.getParameter(WebGLRenderingContext.ARRAY_BUFFER_BINDING);
const elementArrayBufferBinding = gl.getParameter(WebGLRenderingContext.ELEMENT_ARRAY_BUFFER_BINDING);
this.pushed = true;

const popUpdate = () => {
gl.bindBuffer(WebGLRenderingContext.ARRAY_BUFFER, arrayBufferBinding);
gl.bindBuffer(WebGLRenderingContext.ELEMENT_ARRAY_BUFFER, elementArrayBufferBinding);
this.pushed = false;
};
return popUpdate;
}
wrap(fn) {
let popUpdate = null;
if (!ImmediateGLBufferAttribute.pushed) {
popUpdate = ImmediateGLBufferAttribute.pushUpdate();
}

fn();

popUpdate && popUpdate();
}
update(offset, count, array = this.array, srcOffset = offset) {
this.wrap(() => {
const renderer = getRenderer();
const gl = renderer.getContext();
const target = this.getTarget();

gl.bindBuffer(target, this.buffer);
gl.bufferSubData(
target,
offset * this.elementSize,
array,
srcOffset,
count
);
});
}
}
116 changes: 109 additions & 7 deletions ai/lore/lore-ai.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,35 @@ import {
defaultPlayerBio,
defaultObjectName,
defaultObjectDescription,

makeLorePrompt,
makeLoreStop,
postProcessResponse,
parseLoreResponses,

makeCommentPrompt,
makeCommentStop,
parseCommentResponse,
postProcessResponse,
parseLoreResponses,

makeSelectTargetPrompt,
makeSelectTargetStop,
parseSelectTargetResponse,

makeSelectCharacterPrompt,
makeSelectCharacterStop,
parseSelectCharacterResponse,

makeChatPrompt,
makeChatStop,
parseChatResponse,

makeOptionsPrompt,
makeOptionsStop,
parseOptionsResponse,

makeCharacterIntroPrompt,
makeCharacterIntroStop,
parseCharacterIntroResponse,
} from './lore-model.js'

const numGenerateTries = 5;
Expand Down Expand Up @@ -193,11 +215,11 @@ class AIScene {
});
const stop = makeLoreStop(this.localCharacter, 0);
let response = await this.generateFn(prompt, stop);
console.log('got lore', {prompt, response});
// console.log('got lore', {prompt, response});
response = postProcessResponse(response, this.characters, dstCharacter);
return response;
}
async generateComment(name, dstCharacter = null) {
async generateLocationComment(name, dstCharacter = null) {
const prompt = makeCommentPrompt({
settings: this.settings,
dstCharacter,
Expand All @@ -206,9 +228,76 @@ class AIScene {
const stop = makeCommentStop();
let response = await this.generateFn(prompt, stop);
response = parseCommentResponse(response);
console.log('got comment', {prompt, response});
// console.log('got comment', {prompt, response});
return response;
}

// XXX needs better API
async generateSelectTargetComment(name, description) {
const prompt = makeSelectTargetPrompt({
name,
description,
});
console.log('select target prompt', {prompt});
const stop = makeSelectTargetStop();
let response = await this.generateFn(prompt, stop);
console.log('select target response', {prompt, response});
response = parseSelectTargetResponse(response);
// console.log('got comment', {prompt, response});
return response;
}
async generateSelectCharacterComment(name, description) {
const prompt = makeSelectCharacterPrompt({
name,
description,
});
console.log('select character prompt', {prompt});
const stop = makeSelectCharacterStop();
let response = await this.generateFn(prompt, stop);
console.log('select character response', {prompt, response});
const response2 = parseSelectCharacterResponse(response);
console.log('select character parsed', {response2});
return response2;
}
async generateChatMessage(messages, nextCharacter) {
const prompt = makeChatPrompt({
messages,
nextCharacter,
});
console.log('chat prompt', {prompt});
const stop = makeChatStop();
let response = await this.generateFn(prompt, stop);
console.log('chat response', {prompt, response});
const response2 = parseChatResponse(response);
console.log('chat parsed', {response2});
return response2;
}
async generateDialogueOptions(messages, nextCharacter) {
const prompt = makeOptionsPrompt({
messages,
nextCharacter,
});
console.log('dialogue options prompt', {prompt});
const stop = makeOptionsStop();
let response = await this.generateFn(prompt, stop);
console.log('dialogue options response', {prompt, response});
const response2 = parseOptionsResponse(response);
console.log('dialogue options parsed', {response2});
return response2;
}
async generateCharacterIntroPrompt(name, bio) {
const prompt = makeCharacterIntroPrompt({
name,
bio,
});
console.log('dialogue options prompt', {prompt});
const stop = makeCharacterIntroStop();
let response = await this.generateFn(prompt, stop);
console.log('dialogue options response', {prompt, response});
const response2 = parseCharacterIntroResponse(response);
console.log('dialogue options parsed', {response2});
return response2;
}
}

class LoreAI {
Expand All @@ -218,7 +307,9 @@ class LoreAI {
async generate(prompt, {
stop,
max_tokens = 100,
// temperature,
temperature,
frequency_penalty,
presence_penalty,
// top_p,
} = {}) {
if (prompt) {
Expand All @@ -228,6 +319,15 @@ class LoreAI {
if (stop !== undefined) {
query.stop = stop;
}
if (temperature !== undefined) {
query.temperature = temperature;
}
if (frequency_penalty !== undefined) {
query.frequency_penalty = frequency_penalty;
}
if (presence_penalty !== undefined) {
query.presence_penalty = presence_penalty;
}

query.temperature = temperature;
query.top_p = top_p;
Expand Down Expand Up @@ -286,7 +386,9 @@ class LoreAI {
generateFn: (prompt, stop) => {
return this.generate(prompt, {
stop,
// temperature,
temperature: 1,
presence_penalty: 2,
frequency_penalty: 2,
// top_p,
});
},
Expand Down
Loading