Skip to content

Commit 6f53ba0

Browse files
authored
Merge pull request #256 from o-on-x/main
bigint support in logger
2 parents 86d8be9 + a27ba5f commit 6f53ba0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

packages/core/src/embedding.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function getRemoteEmbedding(input: string, options: EmbeddingOptions): Pro
3939
// Construct full URL
4040
const fullUrl = `${baseEndpoint}/embeddings`;
4141

42-
console.log("Calling embedding API at:", fullUrl); // Debug log
42+
//console.log("Calling embedding API at:", fullUrl); // Debug log
4343

4444
const requestOptions = {
4545
method: "POST",
@@ -129,7 +129,7 @@ async function getLocalEmbedding(input: string): Promise<number[]> {
129129

130130
const trimmedInput = trimTokens(input, 8000, "gpt-4o-mini");
131131
const embedding = await embeddingModel.queryEmbed(trimmedInput);
132-
console.log("Embedding dimensions: ", embedding.length);
132+
//console.log("Embedding dimensions: ", embedding.length);
133133
return embedding;
134134
}
135135

packages/core/src/logger.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,20 @@ class ElizaLogger {
7777
const c = this.#getColor(foregroundColor, backgroundColor);
7878
// turns objects into printable strings
7979
strings = strings.map((item) => {
80-
if (typeof item === "object") item = JSON.stringify(item);
80+
if (typeof item === "object") {
81+
// Handle BigInt serialization
82+
return JSON.stringify(item, (key, value) =>
83+
typeof value === 'bigint'
84+
? value.toString()
85+
: value
86+
);
87+
}
8188
return item;
8289
});
8390
console.log(c, strings.join(""), this.#getColorReset());
8491
if (this.closeByNewLine) console.log("");
8592
}
93+
8694
log(...strings) {
8795
const fg = "white";
8896
const bg = "";

0 commit comments

Comments
 (0)