UNPKG

@promptbook/remote-server

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

68 lines (67 loc) 2.11 kB
import type { EmbeddingVector } from '../../execution/EmbeddingVector'; import type { number_id, number_linecol_number } from '../../types/number_id'; import type { string_markdown, string_markdown_text } from '../../types/string_markdown'; import type { string_model_name } from '../../types/string_model_name'; import type { string_name } from '../../types/string_name'; import type { string_keyword } from '../../utils/normalization/IKeywords'; /** * Defines one piece of knowledge in the pipeline * * Note: Knowledge piece is by definition prepared * * Note: [🚉] This is fully serializable as JSON * * @see https://github.com/webgptorg/promptbook/discussions/41 */ export type KnowledgePiecePreparedJson = { /** * Unique name of the knowledge piece based on the title */ readonly name?: string_name; /** * Short title for the information */ readonly title?: string_markdown_text; /** * The information in markdown format */ readonly content?: string_markdown; /** * List of sources where the information comes from */ readonly sources: ReadonlyArray<{ /** * Identifier of the source */ readonly name: string_name; /** * Line number */ readonly line?: number_linecol_number; /** * Column number */ readonly column?: number_linecol_number; }>; /** * List of keywords that are associated with the knowledge piece */ readonly keywords: ReadonlyArray<string_keyword>; /** * List of models embeddings that are associated with the knowledge piece */ readonly index: ReadonlyArray<{ /** * Model name which generated the embedding */ readonly modelName: string_model_name; /** * Embedding vector of the knowledge piece */ readonly position: EmbeddingVector; }>; /** * List of preparation ids that were used to prepare this knowledge piece */ readonly preparationIds: ReadonlyArray<number_id>; };