@promptbook/core
Advanced tools
Comparing version 0.31.0-0 to 0.31.0-1
@@ -1,2 +0,2 @@ | ||
import type { string_model_name } from '.././types/typeAliases'; | ||
import type { number_positive_or_zero, number_tokens, number_usd, string_date_iso8601, string_model_name } from '.././types/typeAliases'; | ||
/** | ||
@@ -29,2 +29,38 @@ * Prompt result is the simplest concept of execution. | ||
/** | ||
* Timing | ||
*/ | ||
readonly timing: { | ||
/** | ||
* Start of the execution | ||
*/ | ||
start: string_date_iso8601; | ||
/** | ||
* First token generated | ||
*/ | ||
firstToken?: string_date_iso8601; | ||
/** | ||
* End of the execution | ||
*/ | ||
complete: string_date_iso8601; | ||
}; | ||
/** | ||
* Usage of the prompt execution | ||
*/ | ||
readonly usage: { | ||
/** | ||
* Cost of the execution in USD | ||
* | ||
* If the cost is unknown, the value is `'UNKNOWN'` | ||
*/ | ||
price: (number_positive_or_zero & number_usd) | 'UNKNOWN'; | ||
/** | ||
* Number of tokens used in the input aka. `prompt_tokens` | ||
*/ | ||
inputTokens: number_tokens; | ||
/** | ||
* Number of tokens used in the output aka. `completion_tokens` | ||
*/ | ||
outputTokens: number_tokens; | ||
}; | ||
/** | ||
* Raw response from the model | ||
@@ -35,2 +71,3 @@ */ | ||
/** | ||
* TODO: [🧠] Maybe timing more accurate then seconds? | ||
* TODO: [🧠] Should here be link to the prompt? | ||
@@ -37,0 +74,0 @@ * TODO: [🧠] Maybe type raw properly - not onject but OpenAI.result.whatever |
@@ -407,2 +407,18 @@ /** | ||
export type string_pgp_key = string; | ||
/** | ||
* Semantic helper for `Date.toISOString()` result | ||
* | ||
* @example "2011-10-05T14:48:00.000Z". | ||
* @see https://en.wikipedia.org/wiki/ISO_8601 | ||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString | ||
*/ | ||
export type string_date_iso8601 = `${number}-${number}-${number}${string}${number}:${number}:${number}${string}`; | ||
/** | ||
* Semantic helper for US Dollars | ||
*/ | ||
export type number_usd = number; | ||
/** | ||
* Semantic helper for number of tokens | ||
*/ | ||
export type number_tokens = number_integer & number_positive_or_zero; | ||
export type number_positive = number; | ||
@@ -409,0 +425,0 @@ export type number_negative = number; |
{ | ||
"name": "@promptbook/core", | ||
"version": "0.31.0-0", | ||
"version": "0.31.0-1", | ||
"description": "Library to supercharge your use of large language models", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -1,2 +0,2 @@ | ||
import type { string_model_name } from '.././types/typeAliases'; | ||
import type { number_positive_or_zero, number_tokens, number_usd, string_date_iso8601, string_model_name } from '.././types/typeAliases'; | ||
/** | ||
@@ -29,2 +29,38 @@ * Prompt result is the simplest concept of execution. | ||
/** | ||
* Timing | ||
*/ | ||
readonly timing: { | ||
/** | ||
* Start of the execution | ||
*/ | ||
start: string_date_iso8601; | ||
/** | ||
* First token generated | ||
*/ | ||
firstToken?: string_date_iso8601; | ||
/** | ||
* End of the execution | ||
*/ | ||
complete: string_date_iso8601; | ||
}; | ||
/** | ||
* Usage of the prompt execution | ||
*/ | ||
readonly usage: { | ||
/** | ||
* Cost of the execution in USD | ||
* | ||
* If the cost is unknown, the value is `'UNKNOWN'` | ||
*/ | ||
price: (number_positive_or_zero & number_usd) | 'UNKNOWN'; | ||
/** | ||
* Number of tokens used in the input aka. `prompt_tokens` | ||
*/ | ||
inputTokens: number_tokens; | ||
/** | ||
* Number of tokens used in the output aka. `completion_tokens` | ||
*/ | ||
outputTokens: number_tokens; | ||
}; | ||
/** | ||
* Raw response from the model | ||
@@ -35,2 +71,3 @@ */ | ||
/** | ||
* TODO: [🧠] Maybe timing more accurate then seconds? | ||
* TODO: [🧠] Should here be link to the prompt? | ||
@@ -37,0 +74,0 @@ * TODO: [🧠] Maybe type raw properly - not onject but OpenAI.result.whatever |
@@ -407,2 +407,18 @@ /** | ||
export type string_pgp_key = string; | ||
/** | ||
* Semantic helper for `Date.toISOString()` result | ||
* | ||
* @example "2011-10-05T14:48:00.000Z". | ||
* @see https://en.wikipedia.org/wiki/ISO_8601 | ||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString | ||
*/ | ||
export type string_date_iso8601 = `${number}-${number}-${number}${string}${number}:${number}:${number}${string}`; | ||
/** | ||
* Semantic helper for US Dollars | ||
*/ | ||
export type number_usd = number; | ||
/** | ||
* Semantic helper for number of tokens | ||
*/ | ||
export type number_tokens = number_integer & number_positive_or_zero; | ||
export type number_positive = number; | ||
@@ -409,0 +425,0 @@ export type number_negative = number; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
683582
290
9217
17
4