modelmix 2.4.4 → 2.4.6

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 +13 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🧬 ModelMix: Unified API for Diverse AI Language Models
1
+ # 🧬 ModelMix: Unified API for Diverse AI LLM
2
2
 
3
3
  **ModelMix** is a versatile module that enables seamless integration of various language models from different providers through a unified interface. With ModelMix, you can effortlessly manage and utilize multiple AI models while controlling parallel requests to avoid provider restrictions.
4
4
 
@@ -82,32 +82,42 @@ Here's a quick example to get you started:
82
82
 
83
83
  ```javascript
84
84
  console.log("\n" + '--------| gpt-4o |--------');
85
- const gpt = mmix.create('gpt-4o', { temperature: 0.5 }).addText("Have you ever eaten a {animal}?");
85
+ const gpt = mmix.create('gpt-4o', { temperature: 0.5 });
86
+ gpt.addText("Have you ever eaten a {animal}?");
86
87
  gpt.replace({ '{animal}': 'cat' });
87
88
  console.log(await gpt.message());
89
+ ```
88
90
 
91
+ ```javascript
89
92
  console.log("\n" + '--------| [writer] claude-3-5-sonnet-20240620 |--------');
90
93
  const setup = {
91
94
  config: { system: "You are a writer like Stephen King" },
92
95
  options: { temperature: 0.5 }
93
96
  }
94
97
  const writer = mmix.create('claude-3-5-sonnet-20240620', setup);
95
- writer.replace({ '{story_title}': 'The Mysterious Package' }) // or claude.replaceKeyFromFile(key, filePath)
98
+ writer.replace({ '{story_title}': 'The Mysterious Package' })
99
+ // or write.replaceKeyFromFile('{story_title}', './title.md');
96
100
  const story = await writer.addTextFromFile('./prompt.md').message();
97
101
  console.log(story);
102
+ ```
98
103
 
104
+ ```javascript
99
105
  console.log("\n" + '--------| [image] claude-3-5-sonnet-20240620 |--------');
100
106
  const claude = mmix.create('claude-3-5-sonnet-20240620', { temperature: 0.5 });
101
107
  claude.addImage("./watson.jpg"); // or claude.addImageFromUrl(url)
102
108
  const imageDescription = await claude.addText("Describe the image").message();
103
109
  console.log(imageDescription);
110
+ ```
104
111
 
112
+ ```javascript
105
113
  console.log("\n" + '--------| pplx-70b-online |--------');
106
114
  const pplx = mmix.create('pplx-70b-online', { max_tokens: 500 });
107
115
  pplx.addText('How much is ETH trading in USD?');
108
116
  const news = await pplx.addText('What are the 3 most recent Ethereum news?').message();
109
117
  console.log(news);
118
+ ```
110
119
 
120
+ ```javascript
111
121
  console.log("\n" + '--------| ollama (llava:latest) |--------');
112
122
  await mmix.create('llava:latest')
113
123
  .addImage("./watson.jpg")
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modelmix",
3
- "version": "2.4.4",
4
- "description": "🧬 ModelMix - Unified API for Diverse AI Language Models.",
3
+ "version": "2.4.6",
4
+ "description": "🧬 ModelMix - Unified API for Diverse AI LLM.",
5
5
  "main": "index.js",
6
6
  "repository": {
7
7
  "type": "git",