@rouvanpm/rouva 0.1.4 → 0.2.1

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
@@ -24,7 +24,7 @@ console.log(response.choices[0].message.content)
24
24
 
25
25
  ## Provider agnostic
26
26
 
27
- Rouva works with all connected providers — Anthropic, OpenAI, Gemini, DeepSeek, Mistral, and xAI Grok. You can request a specific model, force a specific provider, or omit both and let Rouva route to the cheapest capable model automatically.
27
+ Rouva works with all connected providers — Anthropic, OpenAI, Gemini, DeepSeek, and Mistral. You can request a specific model, force a specific provider, or omit both and let Rouva route to the cheapest capable model automatically.
28
28
 
29
29
  ```typescript
30
30
  // Request a specific model
@@ -35,8 +35,8 @@ const res = await rouva.chat.completions.create({
35
35
 
36
36
  // Force a specific provider + model
37
37
  const res = await rouva.chat.completions.create({
38
- provider: 'xai',
39
- model: 'grok-4.3',
38
+ provider: 'gemini',
39
+ model: 'gemini-2.5-pro',
40
40
  messages,
41
41
  })
42
42
 
package/dist/index.d.mts CHANGED
@@ -8,17 +8,29 @@ interface Message {
8
8
  role: 'system' | 'user' | 'assistant';
9
9
  content: string;
10
10
  }
11
- type RouvaProvider = 'anthropic' | 'openai' | 'gemini' | 'deepseek' | 'mistral' | 'xai' | (string & {});
11
+ type RouvaProvider = 'anthropic' | 'openai' | 'gemini' | 'deepseek' | 'mistral' | (string & {});
12
12
  /**
13
13
  * Supported models across all providers.
14
14
  * Omit `model` entirely to let Rouva route to the cheapest capable model automatically.
15
15
  */
16
- type RouvaModel = 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-sonnet-4-6' | 'claude-haiku-4-5-20251001' | 'claude-fable-5' | 'gpt-5-nano' | 'gpt-5-mini' | 'gpt-5' | 'gpt-5.5' | 'gpt-5.5-pro' | 'gpt-4.1-nano' | 'gpt-4.1-mini' | 'gpt-4.1' | 'gpt-4o' | 'gpt-4o-mini' | 'gemini-2.5-flash' | 'gemini-2.5-pro' | 'deepseek-chat' | 'deepseek-reasoner' | 'mistral-small-latest' | 'mistral-large-latest' | 'grok-4.3' | 'grok-4.20-0309-reasoning' | (string & {});
16
+ type RouvaModel = 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-sonnet-4-6' | 'claude-haiku-4-5-20251001' | 'claude-fable-5' | 'gpt-5-nano' | 'gpt-5-mini' | 'gpt-5' | 'gpt-5.5' | 'gpt-5.5-pro' | 'gpt-4.1-nano' | 'gpt-4.1-mini' | 'gpt-4.1' | 'gpt-4o' | 'gpt-4o-mini' | 'gemini-2.5-flash' | 'gemini-2.5-pro' | 'deepseek-chat' | 'deepseek-reasoner' | 'mistral-small-latest' | 'mistral-large-latest' | (string & {});
17
+ /** Anthropic-style text block — the array form of the `system` param */
18
+ interface SystemTextBlock {
19
+ type: 'text';
20
+ text: string;
21
+ }
17
22
  interface ChatCompletionParams {
18
23
  messages: Message[];
24
+ /**
25
+ * System prompt — a plain string or Anthropic-style text blocks.
26
+ * Equivalent to a `role: "system"` message at the head of `messages`;
27
+ * the gateway accepts both forms and re-emits whichever dialect the
28
+ * routed provider expects, so it survives cross-provider routing.
29
+ */
30
+ system?: string | SystemTextBlock[];
19
31
  /**
20
32
  * Target model — omit to let Rouva route intelligently to the cheapest capable model.
21
- * Supports models from any connected provider.
33
+ * Supports models from any connected provider (Anthropic, OpenAI).
22
34
  */
23
35
  model?: RouvaModel;
24
36
  /**
@@ -76,4 +88,4 @@ declare class Rouva {
76
88
  private _createChatCompletion;
77
89
  }
78
90
 
79
- export { type ChatCompletion, type ChatCompletionChoice, type ChatCompletionParams, type ChatCompletionUsage, type Message, Rouva, type RouvaOptions, type RouvaProvider, type RouvaResponseMeta };
91
+ export { type ChatCompletion, type ChatCompletionChoice, type ChatCompletionParams, type ChatCompletionUsage, type Message, Rouva, type RouvaOptions, type RouvaProvider, type RouvaResponseMeta, type SystemTextBlock };
package/dist/index.d.ts CHANGED
@@ -8,17 +8,29 @@ interface Message {
8
8
  role: 'system' | 'user' | 'assistant';
9
9
  content: string;
10
10
  }
11
- type RouvaProvider = 'anthropic' | 'openai' | 'gemini' | 'deepseek' | 'mistral' | 'xai' | (string & {});
11
+ type RouvaProvider = 'anthropic' | 'openai' | 'gemini' | 'deepseek' | 'mistral' | (string & {});
12
12
  /**
13
13
  * Supported models across all providers.
14
14
  * Omit `model` entirely to let Rouva route to the cheapest capable model automatically.
15
15
  */
16
- type RouvaModel = 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-sonnet-4-6' | 'claude-haiku-4-5-20251001' | 'claude-fable-5' | 'gpt-5-nano' | 'gpt-5-mini' | 'gpt-5' | 'gpt-5.5' | 'gpt-5.5-pro' | 'gpt-4.1-nano' | 'gpt-4.1-mini' | 'gpt-4.1' | 'gpt-4o' | 'gpt-4o-mini' | 'gemini-2.5-flash' | 'gemini-2.5-pro' | 'deepseek-chat' | 'deepseek-reasoner' | 'mistral-small-latest' | 'mistral-large-latest' | 'grok-4.3' | 'grok-4.20-0309-reasoning' | (string & {});
16
+ type RouvaModel = 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-sonnet-4-6' | 'claude-haiku-4-5-20251001' | 'claude-fable-5' | 'gpt-5-nano' | 'gpt-5-mini' | 'gpt-5' | 'gpt-5.5' | 'gpt-5.5-pro' | 'gpt-4.1-nano' | 'gpt-4.1-mini' | 'gpt-4.1' | 'gpt-4o' | 'gpt-4o-mini' | 'gemini-2.5-flash' | 'gemini-2.5-pro' | 'deepseek-chat' | 'deepseek-reasoner' | 'mistral-small-latest' | 'mistral-large-latest' | (string & {});
17
+ /** Anthropic-style text block — the array form of the `system` param */
18
+ interface SystemTextBlock {
19
+ type: 'text';
20
+ text: string;
21
+ }
17
22
  interface ChatCompletionParams {
18
23
  messages: Message[];
24
+ /**
25
+ * System prompt — a plain string or Anthropic-style text blocks.
26
+ * Equivalent to a `role: "system"` message at the head of `messages`;
27
+ * the gateway accepts both forms and re-emits whichever dialect the
28
+ * routed provider expects, so it survives cross-provider routing.
29
+ */
30
+ system?: string | SystemTextBlock[];
19
31
  /**
20
32
  * Target model — omit to let Rouva route intelligently to the cheapest capable model.
21
- * Supports models from any connected provider.
33
+ * Supports models from any connected provider (Anthropic, OpenAI).
22
34
  */
23
35
  model?: RouvaModel;
24
36
  /**
@@ -76,4 +88,4 @@ declare class Rouva {
76
88
  private _createChatCompletion;
77
89
  }
78
90
 
79
- export { type ChatCompletion, type ChatCompletionChoice, type ChatCompletionParams, type ChatCompletionUsage, type Message, Rouva, type RouvaOptions, type RouvaProvider, type RouvaResponseMeta };
91
+ export { type ChatCompletion, type ChatCompletionChoice, type ChatCompletionParams, type ChatCompletionUsage, type Message, Rouva, type RouvaOptions, type RouvaProvider, type RouvaResponseMeta, type SystemTextBlock };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rouvanpm/rouva",
3
- "version": "0.1.4",
3
+ "version": "0.2.1",
4
4
  "description": "Official Node.js SDK for Rouva — managed AI gateway with intelligent routing and spend tracking",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",