@promptbook/azure-openai
Version:
Promptbook: Run AI apps in plain human language across multiple models and platforms
41 lines (40 loc) • 1.69 kB
TypeScript
import type { PromptbookStorage } from '../_common/PromptbookStorage';
/**
* Stores data in .env variables
*
* Note: `$` is used to indicate that this function is not a pure function - it uses filesystem to access `.env` file and also writes to `process.env`
*
* @private within the repository - for CLI utils
*/
export declare class $EnvStorage<TItem> implements PromptbookStorage<TItem> {
private envFilename;
private $provideOrCreateEnvFile;
private transformKey;
/**
* Returns the number of key/value pairs currently present in the list associated with the object.
*/
get length(): number;
/**
* Empties the list associated with the object of all key/value pairs, if there are any.
*/
clear(): void;
/**
* Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.
*/
getItem(key: string): Promise<TItem | null>;
/**
* Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object.
*/
key(index: number): string | null;
/**
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
*/
setItem(key: string, value: TItem): Promise<void>;
/**
* Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists.
*/
removeItem(key: string): void;
}
/**
* TODO: Write file more securely - ensure that there can be no accidental overwriting of existing variables and other content
*/