rosetta-ai 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +28 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,18 +2,19 @@
2
2
 
3
3
  The translation layer for LLM provider messages.
4
4
 
5
- Rosetta allows you to seamlessly convert messages between different LLM providers using a standardized intermediate format (GenAI).
5
+ Rosetta converts messages between different LLM providers using a standardized intermediate format (GenAI). Just pass in messages from any provider—OpenAI, Anthropic, Google, or even custom formats—and get consistent output. No manual mapping required.
6
6
 
7
7
  ## Features
8
8
 
9
- - Convert messages from any supported provider to a unified GenAI format
10
- - Convert GenAI messages to any supported provider format
11
- - Automatic provider detection when source is not specified
12
- - Full TypeScript support with strict types
13
- - Runtime validation with Zod schemas
14
- - Preserve provider-specific metadata for lossless round-trips
15
- - Works in Node.js and browsers
16
- - Tree-shakeable ESM build
9
+ - 🔄 Convert messages from any supported provider to a unified GenAI format
10
+ - 🔀 Convert GenAI messages to any supported provider format
11
+ - 🪄 **Universal fallback** - Pass messages from *any* LLM provider or framework, even unsupported ones, and we'll attempt best-effort conversion
12
+ - 🔍 Automatic provider detection when source is not specified
13
+ - 📝 Full TypeScript support with strict types
14
+ - Runtime validation with Zod schemas
15
+ - 💾 Preserve provider-specific metadata for lossless round-trips
16
+ - 🌐 Works in Node.js and browsers
17
+ - 🌳 Tree-shakeable ESM build
17
18
 
18
19
  ## Installation
19
20
 
@@ -115,7 +116,24 @@ const { messages } = translator.translate(inputMessages);
115
116
  | Google Gemini | ✅ Available | ✅ | - |
116
117
  | Compat | ✅ Available | ✅ | - |
117
118
 
118
- **Compat Provider**: A universal fallback that attempts to convert any message format to GenAI. It automatically normalizes field names (e.g., `tool_calls` vs `toolCalls`) and detects common LLM message patterns. When auto-detection is enabled and no specific provider matches, Compat is used as the fallback.
119
+ ### Universal Compatibility
120
+
121
+ The **Compat** provider is a universal fallback that handles messages from *any* LLM provider—even ones not explicitly supported. When you call `translate()` without specifying a source provider, Rosetta tries to match against known provider schemas. If none match, it automatically falls back to Compat, which:
122
+
123
+ - Normalizes field names across conventions (`tool_calls`, `toolCalls`, `tool-calls` all work)
124
+ - Detects common patterns: roles, content arrays, tool calls, images, reasoning, etc.
125
+ - Handles formats from Cohere, Mistral, Ollama, AWS Bedrock, LangChain, and more
126
+ - Preserves unrecognized data so nothing is lost
127
+
128
+ ```typescript
129
+ // Works with any provider - no need to specify the source
130
+ const weirdMessages = [
131
+ { role: "user", content: "Hello" },
132
+ { role: "assistant", tool_calls: [{ id: "1", function: { name: "search", arguments: "{}" } }] },
133
+ ];
134
+
135
+ const { messages } = translate(weirdMessages); // Just works™
136
+ ```
119
137
 
120
138
  More providers will be added. See [AGENTS.md](./AGENTS.md) for contribution guidelines.
121
139
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rosetta-ai",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "author": "Latitude Data SL",
5
5
  "license": "MIT",
6
6
  "description": "The translation layer for LLM provider messages",