@falkordb/text-to-cypher 0.1.10 → 0.1.12

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/README.md CHANGED
@@ -142,40 +142,51 @@ console.log('Relationships:', schemaObj.relationships);
142
142
 
143
143
  Lists all available AI models across all supported providers.
144
144
 
145
- **Returns:** `Promise<string[]>`
145
+ **Note:** This method queries all provider APIs (OpenAI, Anthropic, Gemini, Ollama) and aggregates the results. Models are returned with provider prefixes (except OpenAI).
146
+
147
+ **Returns:** `Promise<string[]>` - Array of model names with provider prefixes where applicable
146
148
 
147
149
  **Example:**
148
150
  ```javascript
149
151
  const models = await client.listModels();
150
- console.log('Available models:', models);
151
- // Output: ['gpt-4o-mini', 'gpt-4o', 'anthropic:claude-3-5-sonnet-20241022', ...]
152
+ console.log('All available models:', models);
153
+ // Output: [
154
+ // 'gpt-4o-mini', 'gpt-4o', 'gpt-4-turbo', // OpenAI (no prefix)
155
+ // 'anthropic:claude-sonnet-4-5', 'anthropic:claude-opus-4-5', // Anthropic
156
+ // 'gemini:gemini-2.5-pro', 'gemini:gemini-3-pro-preview', // Gemini
157
+ // 'ollama:llama3', 'ollama:mistral' // Ollama (if running)
158
+ // ]
152
159
  ```
153
160
 
154
161
  ### `listModelsByProvider(provider)`
155
162
 
156
- Lists available AI models from a specific provider.
163
+ Lists available AI models from a specific provider by querying the actual provider APIs.
164
+
165
+ **Note:** This method makes real API calls to the AI providers to get current model listings. The availability depends on your API credentials and the current offerings from each provider.
157
166
 
158
167
  **Parameters:**
159
- - `provider` (string): Provider name - `'openai'`, `'anthropic'`, `'gemini'`, or `'ollama'`
168
+ - `provider` (string): Provider name - `'openai'`, `'anthropic'`, `'gemini'`, or `'ollama'` (case-insensitive)
160
169
 
161
- **Returns:** `Promise<string[]>`
170
+ **Returns:** `Promise<string[]>` - Array of model names (without provider prefixes)
162
171
 
163
172
  **Example:**
164
173
  ```javascript
165
174
  // List OpenAI models
166
175
  const openaiModels = await client.listModelsByProvider('openai');
167
176
  console.log('OpenAI models:', openaiModels);
168
- // Output: ['gpt-4o-mini', 'gpt-4o', 'gpt-4-turbo', 'gpt-4', 'gpt-3.5-turbo']
177
+ // Output: ['gpt-4o-mini', 'gpt-4o', 'gpt-4-turbo', ...]
169
178
 
170
179
  // List Anthropic models
171
180
  const anthropicModels = await client.listModelsByProvider('anthropic');
172
181
  console.log('Anthropic models:', anthropicModels);
182
+ // Output: ['claude-sonnet-4-5', 'claude-opus-4-5', 'claude-haiku-4-5']
173
183
 
174
184
  // List Gemini models
175
185
  const geminiModels = await client.listModelsByProvider('gemini');
176
186
  console.log('Gemini models:', geminiModels);
187
+ // Output: ['gemini-2.5-pro', 'gemini-3-pro-preview', ...]
177
188
 
178
- // List Ollama models
189
+ // List Ollama models (requires Ollama running locally)
179
190
  const ollamaModels = await client.listModelsByProvider('ollama');
180
191
  console.log('Ollama models:', ollamaModels);
181
192
  ```
@@ -185,11 +196,11 @@ console.log('Ollama models:', ollamaModels);
185
196
  - **`openai`** - OpenAI models (GPT-4, GPT-3.5, etc.)
186
197
  - Models can be used directly: `'gpt-4o-mini'`
187
198
  - **`anthropic`** - Anthropic models (Claude variants)
188
- - Models require prefix: `'anthropic:claude-3-5-sonnet-20241022'`
199
+ - Models require prefix when using: `'anthropic:claude-sonnet-4-5'`
189
200
  - **`gemini`** - Google Gemini models
190
- - Models require prefix: `'gemini:gemini-2.0-flash-exp'`
201
+ - Models require prefix when using: `'gemini:gemini-2.5-pro'`
191
202
  - **`ollama`** - Local Ollama models (if configured)
192
- - Models require prefix: `'ollama:llama3'`
203
+ - Models require prefix when using: `'ollama:llama3'`
193
204
 
194
205
  See the [examples/list-models.js](examples/list-models.js) file for a complete working example.
195
206
 
@@ -1,10 +1,13 @@
1
1
  /**
2
2
  * Model Discovery Example for @falkordb/text-to-cypher
3
- *
3
+ *
4
4
  * This example demonstrates how to:
5
- * 1. List all available AI models across all providers
5
+ * 1. List all available models across all providers
6
6
  * 2. List models from specific providers (OpenAI, Anthropic, Gemini, Ollama)
7
7
  * 3. Handle provider-specific model naming conventions
8
+ * 4. Use the discovered models in your client configuration
9
+ *
10
+ * Note: This queries the actual AI provider APIs for current model listings.
8
11
  */
9
12
 
10
13
  const { TextToCypher } = require('../index');
@@ -25,15 +28,13 @@ async function main() {
25
28
 
26
29
  try {
27
30
  // Example 1: List all available models
28
- console.log('1. Listing all available models across all providers...');
31
+ console.log('1. Listing all available models...');
29
32
  const allModels = await client.listModels();
30
- console.log('\nAll available models:');
33
+ console.log(`\nFound ${allModels.length} total models:\n`);
31
34
  allModels.forEach((model, index) => {
32
- console.log(` ${index + 1}. ${model}`);
35
+ console.log(` ${(index + 1).toString().padStart(2)}. ${model}`);
33
36
  });
34
- console.log(`\nTotal: ${allModels.length} models\n`);
35
-
36
- console.log('---\n');
37
+ console.log('\n---\n');
37
38
 
38
39
  // Example 2: List models by provider
39
40
  console.log('2. Listing models by provider...\n');
@@ -82,11 +83,12 @@ async function main() {
82
83
 
83
84
  // Example 5: Provider-specific naming conventions
84
85
  console.log('5. Note on provider-specific naming conventions:');
85
- console.log('\nOpenAI models can be used directly:');
86
+ console.log('\nThe API returns model names without prefixes.');
87
+ console.log('When using models, OpenAI models can be used directly:');
86
88
  console.log(' model: \'gpt-4o-mini\'');
87
- console.log('\nOther providers require a prefix:');
88
- console.log(' model: \'anthropic:claude-3-5-sonnet-20241022\'');
89
- console.log(' model: \'gemini:gemini-2.0-flash-exp\'');
89
+ console.log('\nOther providers require adding a prefix:');
90
+ console.log(' model: \'anthropic:claude-sonnet-4-5\'');
91
+ console.log(' model: \'gemini:gemini-2.5-pro\'');
90
92
  console.log(' model: \'ollama:llama3\'\n');
91
93
 
92
94
  } catch (error) {
package/index.d.ts CHANGED
@@ -174,23 +174,19 @@ export declare class TextToCypher {
174
174
  /**
175
175
  * Lists all available AI models across all supported providers
176
176
  *
177
- * Returns a list of commonly available models from OpenAI, Anthropic, Gemini, and Ollama.
178
- *
179
- * # Note
180
- *
181
- * This method returns a curated list of well-known models. The actual availability
182
- * of models depends on your API credentials and the current offerings from each provider.
177
+ * This method queries all provider APIs (OpenAI, Anthropic, Gemini, Ollama) and
178
+ * returns a combined list of available models with provider prefixes.
183
179
  *
184
180
  * # Returns
185
181
  *
186
- * A promise that resolves to an array of model names
182
+ * A promise that resolves to an array of model names with provider prefixes
187
183
  *
188
184
  * # Example
189
185
  *
190
186
  * ```javascript
191
- * const models = await client.listModels();
192
- * console.log('Available models:', models);
193
- * // Output: ['gpt-4o-mini', 'gpt-4o', 'claude-3-5-sonnet-20241022', ...]
187
+ * const allModels = await client.listModels();
188
+ * console.log('All models:', allModels);
189
+ * // Output: ['gpt-4o-mini', 'gpt-4o', 'anthropic:claude-sonnet-4-5', 'gemini:gemini-2.5-pro', ...]
194
190
  * ```
195
191
  */
196
192
  listModels(): Promise<Array<string>>
@@ -203,12 +199,12 @@ export declare class TextToCypher {
203
199
  *
204
200
  * # Note
205
201
  *
206
- * This method returns a curated list of well-known models. The actual availability
207
- * of models depends on your API credentials and the current offerings from each provider.
202
+ * This method queries the actual AI provider APIs to get the list of available models.
203
+ * The availability depends on your API credentials and the current offerings from each provider.
208
204
  *
209
205
  * # Returns
210
206
  *
211
- * A promise that resolves to an array of model names for the specified provider
207
+ * A promise that resolves to an array of model names for the specified provider (without prefixes)
212
208
  *
213
209
  * # Example
214
210
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@falkordb/text-to-cypher",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Node.js bindings for FalkorDB text-to-cypher library - Convert natural language to Cypher queries",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
Binary file
Binary file
Binary file
Binary file
Binary file