🔄 Big News! bazed.ai is now sagentic.ai. Same vision, new name!

Skip to content

@sagentic-ai/sagentic-af / PCT

PCT ​

PCT stands for prompt, completion and total quantities

Constructors ​

new PCT(data) ​

ts
new PCT(data?): PCT

Create a new PCT, zeroed by default if no data is provided. If data is provided, total will be computed by adding prompt and completion quantities.

Parameters ​

• data?

optional object with prompt and completion quantities

• data.completion?: number

• data.prompt?: number

Returns ​

PCT

Source ​

src/ledger.ts:24

Properties ​

_total ​

ts
_total: number;

Source ​

src/ledger.ts:14


completion ​

ts
completion: number;

Source ​

src/ledger.ts:13


prompt ​

ts
prompt: number;

Source ​

src/ledger.ts:12

Accessors ​

total ​

ts
get total(): number

Returns ​

number

Source ​

src/ledger.ts:16

Methods ​

add() ​

ts
add(other): PCT

Add another PCT to this one, mutates receiver.

Parameters ​

• other: PCT

PCT to add to this one

Returns ​

PCT

Source ​

src/ledger.ts:39