@elizaos/plugin-knowledge 1.0.0-beta.72 → 1.0.0-beta.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -67,7 +67,7 @@ interface ProviderRateLimits {
67
67
  * Options for text generation overrides
68
68
  */
69
69
  interface TextGenerationOptions {
70
- provider?: "anthropic" | "openai" | "openrouter" | "google";
70
+ provider?: 'anthropic' | 'openai' | 'openrouter' | 'google';
71
71
  modelName?: string;
72
72
  maxTokens?: number;
73
73
  /**
@@ -85,7 +85,7 @@ interface TextGenerationOptions {
85
85
  * This can reduce costs by up to 90% for reads after the initial cache write.
86
86
  */
87
87
  cacheOptions?: {
88
- type: "ephemeral";
88
+ type: 'ephemeral';
89
89
  };
90
90
  /**
91
91
  * Whether to automatically detect and enable caching for contextual retrieval.
@@ -98,33 +98,59 @@ interface TextGenerationOptions {
98
98
  * Options for adding knowledge to the system
99
99
  */
100
100
  interface AddKnowledgeOptions {
101
+ worldId: UUID;
102
+ roomId: UUID;
103
+ entityId: UUID;
101
104
  /** Client-provided document ID */
102
105
  clientDocumentId: UUID;
103
106
  /** MIME type of the file */
104
107
  contentType: string;
105
108
  /** Original filename */
106
109
  originalFilename: string;
107
- /** World ID for storage */
108
- worldId: UUID;
109
110
  /**
110
111
  * Content of the document. Should be:
111
112
  * - Base64 encoded string for binary files (PDFs, DOCXs, etc)
112
113
  * - Plain text for text files
113
114
  */
114
115
  content: string;
115
- /** Optional room ID for storage scoping */
116
- roomId?: UUID;
117
- /** Optional entity ID for storage scoping */
118
- entityId?: UUID;
119
116
  }
120
- declare module "@elizaos/core" {
117
+ declare module '@elizaos/core' {
121
118
  interface ServiceTypeRegistry {
122
- KNOWLEDGE: "knowledge";
119
+ KNOWLEDGE: 'knowledge';
123
120
  }
124
121
  }
125
122
  declare const KnowledgeServiceType: {
126
123
  KNOWLEDGE: "knowledge";
127
124
  };
125
+ interface KnowledgeDocumentMetadata extends Record<string, any> {
126
+ type: string;
127
+ source: string;
128
+ title?: string;
129
+ filename?: string;
130
+ fileExt?: string;
131
+ fileType?: string;
132
+ fileSize?: number;
133
+ url?: string;
134
+ timestamp: number;
135
+ documentId?: string;
136
+ }
137
+ interface KnowledgeConfig {
138
+ CTX_KNOWLEDGE_ENABLED: boolean;
139
+ LOAD_DOCS_ON_STARTUP: boolean;
140
+ MAX_INPUT_TOKENS?: string | number;
141
+ MAX_OUTPUT_TOKENS?: string | number;
142
+ EMBEDDING_PROVIDER?: string;
143
+ TEXT_PROVIDER?: string;
144
+ TEXT_EMBEDDING_MODEL?: string;
145
+ }
146
+ interface LoadResult {
147
+ successful: number;
148
+ failed: number;
149
+ errors?: Array<{
150
+ filename: string;
151
+ error: string;
152
+ }>;
153
+ }
128
154
 
129
155
  /**
130
156
  * Knowledge Plugin - Main Entry Point
@@ -137,4 +163,4 @@ declare const KnowledgeServiceType: {
137
163
  */
138
164
  declare const knowledgePlugin: Plugin;
139
165
 
140
- export { type AddKnowledgeOptions, KnowledgeServiceType, type ModelConfig, ModelConfigSchema, type ProviderRateLimits, type TextGenerationOptions, knowledgePlugin as default, knowledgePlugin };
166
+ export { type AddKnowledgeOptions, type KnowledgeConfig, type KnowledgeDocumentMetadata, KnowledgeServiceType, type LoadResult, type ModelConfig, ModelConfigSchema, type ProviderRateLimits, type TextGenerationOptions, knowledgePlugin as default, knowledgePlugin };
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Agent Plugin View</title>
8
+ <script type="module" crossorigin src="./assets/index-BQPj32JK.js"></script>
9
+ <link rel="stylesheet" crossorigin href="./assets/index-Cfdtl60S.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>