@promptbook/remote-server
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
40 lines (39 loc) • 1.23 kB
TypeScript
import type { string_book } from '../book-2.0/agent-source/string_book';
import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
/**
* Parser for the agent source for Promptbook agents in book language
*
* @public exported from `@promptbook/core`
*/
export declare class Book {
readonly agentName: string;
readonly commitments: ReadonlyArray<Commitment>;
private readonly messageBlocks;
static parse(source: string_book): Book;
/**
* Creates one Book from already structured message blocks.
*
* @public exported from `@promptbook/core`
*/
static fromMessages(messages: ReadonlyArray<Pick<ChatMessage, 'content'> & {
sender: string;
}>, options?: {
agentName?: string;
commitments?: ReadonlyArray<Commitment>;
}): Book;
private constructor();
stringify(): string_book;
getMessages(): ReadonlyArray<ChatMessage>;
/**
* Gets the newest parsed chat message written by the given sender.
*
* @public exported from `@promptbook/core`
*/
getLatestMessageBySender(sender: string): ChatMessage | null;
}
type Commitment = {
type: string;
subject: string;
content: string;
};
export {};